HTML <th> heightProperty
Example
Two header cells with a predefined height:
<table border="1">
<tr>
<th height="100">Month</th>
<th height="100">Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
<tr>
<th height="100">Month</th>
<th height="100">Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the height attribute.
Definition and Usage
HTML5 does not support the <th> height attribute. Use CSS instead.
In HTML 4.01, the height attribute of <th>Deprecated。
The height attribute specifies the height of a header cell.
Normally, if the height attribute is not set, the space occupied by a header cell is the space required for its displayed content. The height attribute is used to set a predefined height for header cells.
Compatibility Notes
In HTML 4.01, the height attribute of <th> is deprecated. Please use CSS instead.
CSS Syntax: <th style="height:100px">
CSS Example: Set the height of the table header cell
In our CSS tutorial, you can find more information aboutheight AttributeDetails.
Syntax
<th height="pixels|%">
Property value
| Value | Description |
|---|---|
| pixels | Set the height value in pixels (for example, height="50"). |
| % | Set the height value as a percentage of the containing element (for example, height="50%"). |
HTML <th> Tagother extensions