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

HTML Reference Manual

Comprehensive List of HTML Tags

HTML td height attribute

The td height attribute specifies the height of the cell. Usually, the cell takes up the space required for its display content. The height attribute is used to set the predefined height of the cell.

 HTML <td> tag

Online Example

Two table cells with predefined heights:

<table border="1">
  <tr>
      <th>Programming Language Books</th>
      <th>Price</th>
  </tr>
    <tr>
      <td height="80">PHP Basics Tutorial</td>
      <td height="80">$50</td>
    </tr>
    <tr>
      <td>Java Programming: Thinking in Java</td>
      <td>$80</td>
    </tr>
</table>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All major browsers support the height attribute.

Definition and Usage

HTML5 The <td> height attribute is not supported. Please use CSS instead.

In HTML 4.01 In this document, the <td> height attribute is deprecated.

 The height attribute specifies the height of the cell.

By default, cells will take up the space required by their display content. The height attribute is used to set a predefined height for the cell.

Compatibility Notes

In HTML 4.01 In this document, the <td> height attribute is deprecated. Please use CSS instead.

CSS Syntax: <td style="height:100px">

CSS Example: Setting the height of table cells

In our CSS tutorial, you can find more about height Attribute . Details.

Syntax

<td 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 (e.g., height="50%").
 HTML <td> tag