English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<th> The height attribute specifies the height of the header cell. If the height attribute is not set, the header cell will occupy the space required for the displayed content. The height attribute is used to set the predefined height of the header cell.
Predefined Header Cell Height50 pixels:
<table style="width:100%;" border="1"> <tr> <th height="50">Doll Manufacturer</th> <th height="50">Doll Type</th> </tr> <tr> <td>Barbie Princess</td> <td>6Joint Barbie Doll</td> </tr> <tr> <td>Barbie Princess</td> <td>12Joint Barbie Doll</td> </tr> </table>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the height attribute.
HTML5 The <th> height attribute is not supported. Please use CSS instead.
In HTML 4.01 In the following, the height attribute of <th> is deprecated.
The height attribute specifies the height of the header cell.
If the height attribute is not set, the header cell will take up the space required for the displayed content. The height attribute is used to set the predefined height of the header cell.
In HTML 4.01 In the following, 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 aboutheight Attribute . Details.
<th height="pixels|%">
Value | Description |
---|---|
pixels | Set the height value in pixels (e.g., height="50"). |
% | Set the height value as a percentage of the element's size (e.g., height="50%"). |