English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <th> height attribute

<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.

 HTML <th> tag

Online Example

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 ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the height attribute.

Definition and Usage

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.

Compatibility Notes

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.

Syntax

<th height="pixels|%">

Attribute Value

ValueDescription
pixelsSet 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%").
 HTML <th> tag