A RetroSearch Logo

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

Search Query:

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

HTML <td> headers Attribute - GeeksforGeeks

HTML <td> headers Attribute

Last Updated : 12 Jul, 2025

The HTML <td> headers attribute specifies the header cells related to a table cell, aiding accessibility for screen readers without visual impact in web browsers.

Syntax

<td headers="header_id">
Attribute Valuescells

Name

Description

header_id

specify the space to the separated list of id to one or more Header cells that the table data cell is related to. 

HTML <td> headers attribute Example

Example: In this example we demonstrates the usage of the <td> headers attribute for associating data cells with header cells in a table, enhancing accessibility and aiding screen readers in interpreting tabular data.

html
<!DOCTYPE html>
<html>
    <head>
        <style>
            table,
            th,
            td {
                border: 1px solid green;
            }
        </style>
    </head>

    <body>
        <h2>
            HTML <td> Headers Attributes
        </h2>

        <table>
            <tr>
                <th id="name">Name</th>
                <th id="father">Father's Name</th>
                <th id="mother">Mother's Name</th>
                <th id="phone">Phone No.</th>
            </tr>
            <tr>
                <td headers="name">Krishna</td>
                <td headers="father">
                    Manoj Gupta
                </td>
                <td headers="mother">
                    Manisha Gupta
                </td>
                <td headers="phone">12345</td>
            </tr>
        </table>
        <br />
    </body>
</html>

Output:

 Supported Browsers:

The browsers supported by HTML <td> 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