HTML td headers attribute

Example

The following example shows the table header related to each cell:
<table border="1" width="100%">
  <tr>
    <th id="name">Name</td>
    <th id="email">Email</td>
    <th id="phone">Phone</td>
    <th id="addr">Address</td>
  </tr>
  <tr>
    <td headers="name">John Doe</td>
    <td headers="email">someone@example.com</td>
    <td headers="phone">+45342323</td>
    <td headers="addr">Rosevn 56,4300 Sandnes,Norway</td>
  </tr>
</table>


Definition and Usage

The headers attribute specifies the table headers related to a cell.
The headers attribute makes no visual difference in ordinary web browsers.
This attribute can be used by screen readers.

Browser Support

Since there is no visual difference in ordinary web browsers, it’s difficult to say whether or not they support the headers attribute.

Syntax

<td headers="value">

Attribute Values

Value Description
headercells'_id Specifies the id of one or more header cells the table cell is related to. (To specify more than one id: separate them with spaces)
Share this article :
 
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved