W3Schools
w3schools.com › tags › tag_td.asp
HTML td tag
The <td> tag defines a standard data cell in an HTML table.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › td
<td> HTML table data cell element - MDN Web Docs
5 days ago - Defines the cells that the header (defined in the <th>) element relates to. The possible enumerated values are row, col, rowgroup, and colgroup. Only use this attribute with the <th> element to define the row or column for which it is a header, as this attribute is deprecated for the <td> element.
Videos
01:00
HTML td Tag Attributes | HTML Tables | #html #shorts 23 🚀 - YouTube
03:22
How to create HTML Tables Table tags Table Row TR TD Table HTML ...
04:43
Learn HTML tables in 4 minutes! 📊 - YouTube
05:53
HTML: table, tr, td - YouTube
03:58
Learn HTML tables in 3 minutes 📊 - YouTube
W3Schools
w3schools.com › html › html_tables.asp
HTML Tables
HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts · ❮ Previous Next ❯ · HTML tables allow web developers to arrange data into rows and columns. Try it Yourself » · A table in HTML consists of table cells inside rows and columns. A simple HTML table: <table> <tr> <th>Company</th> <th>Contact</th> <th>Country</th> </tr> <tr> <td>Alfreds Futterkiste</td> <td>Maria Anders</td> <td>Germany</td> </tr> <tr> <td>Centro comercial Moctezuma</td> <td>Francisco Chang</td> <td>Mexico</td> </tr> </table> Try it Yourself » ·
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Element › td
<td>: The Table Data Cell element - HTML - MDN Web Docs
Defines the background color of the data cell. The value is an HTML color; either a 6-digit hexadecimal RGB code, prefixed by a #, or a color keyword. Other CSS <color> values are not supported.
Tutorialspoint
tutorialspoint.com › html › html_td_tag.htm
HTML - <td> Tag
Let's look at the following example, where we are going to consider the basic usage of the <td> tag. <!DOCTYPE html> <html> <style> table, th, td { border: 2px solid #5DADE2; } </style> <body> <table> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> </tr> </table> </body> </html>
TechOnTheNet
techonthenet.com › html › elements › td_tag.php
HTML: <td> tag
In this HTML5 Document example, we have created a table using the <table> tag that has 2 columns and 4 rows. Row 1 of the table is defined using the first <tr> tag. It has 2 table heading cells defined using the <th> tag. Rows 2 - 4 of the table use the <td> tag to define standard table cells.
HTML.com
html.com › tags › td
Dealing With Td Layout Issues In HTML5 - Quick Tutorial »
October 11, 2019 - <table> <tr> <th>Awesome</th> <th>Acceptable</th> <th>Ugh</th> </tr> <tr> <td>Saturday</td> <td>Thursday</td> <td>Monday</td> </tr> <tr> <td>Sunny</td> <td>Partly Cloudy</td> <td>Wintery Mix</td> </tr> <tr> <td>Comfortable</td> <td>Cool</td> <td>Frigid</td> </tr> </table> Tables are the right choice for presenting tabular data that is difficult to present in other formats. Each data cell in an HTML table is added individually as a <td> element.
Reddit
reddit.com › r/learnprogramming › use or in table html?
r/learnprogramming on Reddit: Use <td> or <th> in table html?
August 30, 2025 -
Hello, i just started to learn web dev in codeacademy and one of the lessons about html kind of confused me.
In the second <tr> of the code, the tutorial use <th> instead of <td> why is that?
wasn't it better to use <td> instead of <th> because it was on the second row (use for data) and not the first row (use for heading of the table)?
Here are the original code
<table>
<tr>
<th></th>
<th scope="col">Saturday</th>
<th scope="col">Sunday</th>
</tr>
<tr>
<th scope="row">Temperature</th> <!-- this code use th why not td? -->
<td>73</td>
<td>81</td>
</tr>
</table>And here what i mean:
<table>
<tr>
<th></th>
<th scope="col">Saturday</th>
<th scope="col">Sunday</th>
</tr>
<tr>
<td>Temperature</td> <!-- this code use td -->
<td>73</td>
<td>81</td>
</tr>
</table> Top answer 1 of 9
16
This is simply to get a different formatting for the leftmost cell. Semantically, this is correct, as the leftmost cell is also a header cell, just a row header instead of a column header. If you look at the original HTML you see that the very first, leftmost cell in the header row is empty. The first, leftmost cell is used as heading as well. Pretty much like: Saturday | Sunday | Temperature | 73 With your code, this would look like: Saturday | Sunday | Temperature | 73
2 of 9
4
Maybe because it is the header for that row. The next line might contain humidities.
W3C
w3.org › TR › html401 › struct › tables.html
Tables in HTML documents
<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell--> <!-- Scope is simpler than headers attribute for common tables --> <!ENTITY % Scope "(row|col|rowgroup|colgroup)"> <!-- TH is for headers, TD for data, but for cells acting as both use TD --> <!ATTLIST (TH|TD) -- header or data cell -- %attrs; -- %coreattrs, %i18n, %events -- abbr %Text; #IMPLIED -- abbreviation for header cell -- axis CDATA #IMPLIED -- comma-separated list of related headers-- headers IDREFS #IMPLIED -- list of id's for header cells -- scope %Scope; #IMPLIED -- scope covered by header cells -- rowspan NUMBER 1 -- number of rows spanned by cell -- colspan NUMBER 1 -- number of cols spanned by cell -- �llhalign; -- horizontal alignment in cells -- �llvalign; -- vertical alignment in cells -- >
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › table
<table> HTML table element - MDN Web Docs - Mozilla
4 days ago - tfoot > tr { border-top: 2px dashed rgb(140 140 140); background-color: rgb(228 240 245); } tfoot th, tfoot td { text-align: right; font-weight: bold; } A common issue with tables on the web is that they don't natively work very well on small screens when the amount of content is large, and ...
W3C
w3.org › MarkUp › html3 › tablecells.html
Table Cells (TH and TD)
The TH and TD elements are used for table cells. TH is used for table header cells while TD is used for table data cells. This distinction gives user agents a means to render such cells distinctly, for instance by using a larger or heavier font for header cells.
DotFactory
dofactory.com › html › td › style
HTML td style
A style attribute on a <td> tag assigns a unique style to the table cell.
W3C
w3.org › TR › 2010 › WD-html-markup-20100624 › td.html
HTML5: td – table cell
Identifies one or more th elements that apply to its td.
Computer Hope
computerhope.com › jargon › h › html-td-tag.htm
HTML <td> Tag
<table class="mtable2 tab"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr class="tcw"> <td>March</td> <td>$200</td> </tr> <tr class="tcw"> <td>April</td> <td>$300</td> </tr> <tr class="tcw"> <td>May</td> <td>$250</td> </tr> </table> We have added a few of our own classes to the table using CSS (Cascading Style Sheets); this action allows us to improve its appearance. All HTML tags support standard attributes that define the settings of an HTML element.
Mimo
mimo.org › glossary › html › td-tag
HTML <td> Tag: Syntax, Usage, and Examples
January 11, 2026 - Place <td> inside <tr>, pair it with headers using <th>, and use colspan or rowspan when a cell needs to span multiple columns or rows. ... Become a full-stack developer. Learn HTML, CSS, JavaScript, and React as well as NodeJS, Express, and SQL ... You can code, too.
Top answer 1 of 2
98
The width attribute of <td> is deprecated in HTML 5.
Use CSS. e.g.
<td style="width:100px">
in detail, like this:
<table >
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td style="width:70%">January</td>
<td style="width:30%">$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
2 of 2
17
Following width worked well in HTML5: -
<table >
<tr>
<th style="min-width:120px">Month</th>
<th style="min-width:60px">Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Please note that
- TD tag is without CSS style.