Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | headers attribute

Improve Article
Save Article
Like Article
  • Last Updated : 06 Dec, 2021
Improve Article
Save Article
Like Article

The HTML headers attribute specifies one or additional header cells a table cell is expounded to.
 

Applies to: 

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.

Example: 

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: 
 

  • Google Chrome
  • Opera
  • Safari
  • Firefox
  • Internet Explorer

 


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!