This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

td

Summary

Defines a standard Cell in an HTML table.

Overview Table

DOM Interface
HTMLTableDataCellElement

Attributes

  • colspan = valid non-negative integer
    This attribute gives the number of columns respectively that the cell is to span.
  • rowspan = valid non-negative integer
    This attribute gives the number of rows respectively that the cell is to span.
  • headers = unordered set of unique space-separated tokens
    The value of this attribute must have the value of an id attribute of the th element that is targeted.

Examples

This example uses the table element with tr and ****td**** to create a table with three rows and two columns.

<table border="1" width="80%">
  <tbody>
    <tr>
      <td>Row 1, Column 1 text.</td>
      <td>Row 1, Column 2 text.</td>
    </tr>
    <tr>
      <td>Row 2, Column 1 text.</td>
      <td>Row 2, Column 2 text.</td>
    </tr>
  </tbody>
</table>

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation

See also

Related articles

HTML

Tables