HTML <td> headers Attribute
Last Updated :
11 Mar, 2024
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:
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...