Two table cells with a predefined height:
The height attribute specifies the height of a cell.
Normally, a cell takes up the space it needs to display the content. The height attribute is used to set a predefined height of a cell.
Attribute | |||||
---|---|---|---|---|---|
height | Yes | Yes | Yes | Yes | Yes |
The height attribute of <td> is not supported in HTML5. Use CSS instead.
CSS syntax: <td style="height:100px">
CSS Example: Set the height of a table cell
In our CSS tutorial you can find more details about the height property.
Value | Description |
---|---|
pixels | Sets the height in pixels (example: height="50") |
% | Sets the height in percent of the surrounding element (example: height="50%") |