offline version v3


165 of 264 menu

tHead property

The tHead property stores a reference to the thead of a table.

Syntax

table.tHead;

Example

We color a table header red:

<table id="table"> <thead> <tr> <th>header1</th> <th>header2</th> <th>header3</th> </tr> </thead> <tbody> <tr> <td>value</td> <td>value</td> <td>value</td> </tr> <tr> <td>value</td> <td>value</td> <td>value</td> </tr> </tbody> <tfoot> <tr> <td>result</td> <td>result</td> <td>result</td> </tr> </tfoot> </table> let table = document.querySelector('#table'); table.tHead.style.color = 'red';

See also

  • the tFoot property
    that contains tfoot of a table
  • the tBodies property
    that contains tbody of a table
  • the rows property
    that contains rows of a table
  • the cells property
    that contains table cells
enru