A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-headers-attribute/ below:

HTML headers attribute - GeeksforGeeks

HTML headers attribute

Last Updated : 12 Jul, 2025

The HTML headers attribute is used in table cells (td and th elements) to associate data cells with header cells, aiding accessibility by providing context for screen readers and other assistive technologies.

Supported Tags Syntax
<td header="header_value"></td>
<th header="header_value"></th>
Attribute Values

It contains the value i.e header_id which specify the space to the separated list of id’s to one or more Header cell that the table header cell is related to.

HTML headers attribute Example

Example : In this example we defines a table with three columns (Name, Email, Phone) and one row of data. Headers attribute associates data cells with corresponding header cells, aiding accessibility and structure understanding.

html
<!DOCTYPE html>
<html>

<head>
    <style>
        table,
        th,
        td {
            border: 3px solid black;
        }
    </style>
</head>

<body>
    <table style="width: 100%">
        <tr>
            <th id="name">Name</th>
            <th id="email">Email</th>
            <th id="phone">Phone</th>
        </tr>
        <tr>
            <td headers="name">Smith</td>
            <td headers="email">
                someone@gfg.com
            </td>
            <td headers="phone">+9199889</td>
        </tr>
    </table>
</body>

</html>

Output: 


Supported Browsers: The browser supported by HTML headers Attribute are listed below: 



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4