HTML <td> (Table Data) Tag
Example
<table>
<tr>
<th>Heading</th>
<th>Heading</th>
</tr>
<tr>
<td>Table data</td>
<td>Table data</td>
</tr>
<tr>
<td>Foot data</td>
<td>Foot data</td>
</tr>
</table>
Meaning
The <td> element specifies a data cell in a table.
The element should occur within a table row <tr> element.
Notes:
Under the XHTML 1.0 specification, the closing </td> tag ceases to be optional.
Version: HTML 3.2, 4, 4.01, 5
Standard Syntax
<td>...</td>
Browser Support
Status
Attributes
Attribute | Value | Description |
---|---|---|
colspan | number | Specifies the number of columns a cell should span |
headers | header_id | Specifies one or more header cells a cell is related to |
rowspan | number | Sets the number of rows a cell should span |
Global Attributes
The <td> element also supports the Global Attributes in HTML.
Event Attributes
The <td> element also supports the Event Attributes in HTML.
By Default CSS Value(s)
Most of the browsers will display the <td> element with the following by default value(s)
td {
display: table-cell;
vertical-align: inherit;
}