The axis attribute of the <th> tag was used to categorize header cells and define relationships between headers and data cells. It is now obsolete and not supported in HTML5.
- Used to define a category or group name for a header cell.
- Helped associate header cells with related data cells.
- Used only with the <th> element.
Note: The axis attribute is obsolete in HTML5; use scope or headers attributes instead.
Syntax:
<th axis="category_name">Attribute Values:
- category_name: It is used to specify the category name.
<!--Driver Code Starts-->
<!DOCTYPE html>
<html>
<head>
<title>HTML th axis Attribute</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>HTML th axis Attribute</h2>
<!--Driver Code Ends-->
<table width="500" border="1">
<tr>
<th axis="student_name">NAME</th>
<th axis="student_age">AGE</th>
<th axis="student_branch">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-->