Horje
HTML headers Attribute

Definition and Usage

The headers attribute specifies one or more header cells a table cell is related to.


Applies to

The headers attribute can be used on the following elements:

Elements Attribute
<td> headers
<th> headers

Browser Support

The headers attribute has the following browser support for each element.


How to add Specify the <th> element each <td> element is related to

Td Example
index.html
Example: HTML
 <table>
  <tr>
    <th id="name">Name</th>
    <th id="email">Email</th>
    <th id="phone">Phone</th>
    <th id="addr">Address</th>
  </tr>
  <tr>
    <td headers="name">John Doe</td>
    <td headers="email">[email protected]</td>
    <td headers="phone">+45342323</td>
    <td headers="addr">Rosevn 56,4300 Sandnes,Norway</td>
  </tr>
</table> 

Output should be:

How to add Specify the <th> element each <td> element is related to

How to add Specify the <th> element each header cell is related to

Th Example.

index.html
Example: HTML
 <table>
  <tr>
    <th id="name" colspan="2">Name</th>
  </tr>
  <tr>
    <th headers="name">Firstname</th>
    <th headers="name">Lastname</th>
  </tr>
</table> 

Output should be:

How to add Specify the <th> element each header cell is related to




html headers attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference