td

< html‎ | elements
Jump to: navigation, search

td

This article is Almost Ready.


W3C Recommendation

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.


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
1.0
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes
align/valign attribute
1.0
Yes
?
none
?
Yes
?
Yes
?
Yes
char/charoff attribute
1.0
Yes
?
none
?
Yes
?
Yes
?
Yes
bgcolor attribute
?
none
?
none
?
Yes
?
none
?
none
colspan attribute with value 0 (extend to the end of the colgroup)
?
none
?
Yes
?
none
?
none
?
none

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes
align/valign attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown
char/charoff attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown
bgcolor attribute
?
none
?
none
?
Yes
?
none
?
none

Examples

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

HTML

<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

Specification Status Related Changes
HTML 5.1 W3C Working Draft
HTML 5 W3C Recommendation
HTML 4.01 W3C Recommendation

See also

Related articles

HTML


















































… further results

Tables










  • td