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';