td (HTML element)

Spec
Depr. Empty Version
No No HTML 2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

<td abbr="string" axis="string" colspan="number" headers="cell ID …" rowspan="number">
</td>

Description

You can use two kinds of cells in a table: the th element is reserved for cells that contain header information, but the td can be used for any kind of data. Aside from that difference of usage and meaning (and the default presentational differences—th text is bold and centered while td text is non-bold and left-aligned), in almost every other way, the td element behaves, and has the same attributes, as the th element.

The axis and scope attributes can also be used in td elements, and this is a perfectly valid use of HTML, but you’re advised to reserve your usage of these attributes to table headers only. However, the headers and id are almost certainly going to be used in td elements for the purpose of creating relationships between the td content and the header cells (with the th header cell identified using the id attribute and the td associated with it referring to that header with a matching headers attribute).

Finally, this element uses the colspan and rowspan attributes when the content of the cell needs to run across multiple columns or rows.

Example

These td elements are used in a two-column row:

<tr>
  <td>Smart</td>
  <td>From 2%</td>
</tr>

Use This For …

The td is used for content in a table that represents standard data (that’s to say, it’s not a header cell, and most likely falls under a column or row header).

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

It causes no compatibility issues, and has excellent support across all tested browsers.

In this Section

User-contributed notes

Related Products