Easy Tutorial
❮ Jsref Getminutes Prop Datetime Local Type ❯

TableHeader headers Attribute

TableHeader Object

Example

Return the value of the headers attribute for the <th> element with id "myTh":

x Output result is:


Definition and Usage

The headers attribute sets or returns the value of the headers attribute.

The headers attribute specifies a list of header cells that contain header information for the current data cell.


Browser Support

All major browsers support the headers attribute.


Syntax

Return the headers attribute:

Set the headers attribute:

Attribute Values

Value Description
header_ids Specifies a space-separated list of one or more header cell IDs related to the table cell.

Technical Details

| Return Value: | String, containing a space-separated list of header cell identifiers. | | --- | --- |


More Examples

Example

Display the header cells for the second row:

Example

Change the value of the headers attribute for the <th> element with id "myTh":


Related Articles

HTML Reference: HTML <th> headers Attribute


TableHeader Object

❮ Jsref Getminutes Prop Datetime Local Type ❯