The th
tag, or Table Header element, designates a header cell in a <table>
.
The text inside a <th>
tag is bold and centered by default.
<table>
<tr>
<th>This is the heading for the first column</th>
<th>This is the heading for the second column</th>
</tr>
<tr>
<td>First column contents</td>
<td>Second column contents</td>
</tr>
</table>
abbr
Designates an abbreviated version of the header cells content.
colspan
Numerical value for the amount of columns the header cell should span across.
headers
Using a header cell’s id, designates the header cell(s) the cell is related to.
rowspan
Numerical value for the amount of rows a cell should span across.
scope
Designates whether the <th>
is the header for a column (col
), row (row
), a group of columns (colgroup
), or a group of rows (rowgroup
).
Have a code example of <th>
? Submit a codepen.io demo and we'll showcase it here ↴