Skip to: content, navigation

td (HTML element)

Spec
Depr. Empty Version
No No HTML 2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+
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.

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
5.5 6.0 7.0 1.0 1.5 2.0 1.3 2.0 3.0 9.2 9.5
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

ID:
#1
Contributed:
by AutisticCuckoo
Date:
Fri, 28 Mar 2008 12:54:51 GMT

'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.'

The HEADERS attribute will occur in the TD, but the corresponding ID attributes would normally be found in TH elements.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

Search