The height attribute in the <th> tag is used to specify the height of a header cell. It was commonly used in older HTML versions but is now deprecated in HTML5.
- Specifies the height of a header cell.
- Value can be in pixels or percentage.
- Used only with the <th> element.
Note: The height attribute is deprecated in HTML5; use CSS (height) instead.
Syntax
<th height="pixels | %">Attribute Values
- pixels: It sets the height of table header cell in terms of pixels.
- %: It sets the height of table header cell in terms of percentage (%).
<!--Driver Code Starts-->
<!DOCTYPE html>
<html>
<head>
<title>
HTML th height Attribute
</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>HTML th height Attribute</h2>
<!--Driver Code Ends-->
<table border="1" width="500">
<tr>
<th height="50">NAME</th>
<th height="50">AGE</th>
<th height="50">BRANCH</th>
</tr>
<tr>
<td>Ben</td>
<td>22</td>
<td>CSE</td>
</tr>
<tr>
<td>Ron</td>
<td>25</td>
<td>EC</td>
</tr>
</table>
<!--Driver Code Starts-->
</body>
</html>
<!--Driver Code Ends-->