Name
th — HTML 4.01 | HTML5
Synopsis
<th> . . . </th>
Defines a table header cell. Table header cells provide
important information and context to the table cells in the row or
column that they precede. They are an important tool for making the
information in tables accessible. In terms of markup, they function
the same as table data cells (td
).
Start/End Tags
HTML: Required/Optional; XHTML: Required/Required
Attributes
The th
element accepts the
same attributes as the td
element.
See listing under td.
Example
<table> <tr><th>
Planet</th><th>
Distance from Earth</th>
</tr> <tr><td>Venus</td><td>pretty darn far</td></tr> <tr><td>Neptune</td><td>ridiculously far</td></tr> </table>
Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.