Właściwość tHead
Właściwość tHead przechowuje referencję do
thead
tabeli.
Składnia
tabela.tHead;
Przykład
Pokolorujmy nagłówek tabeli na czerwono:
<table id="table">
<thead>
<tr>
<th>header1</th>
<th>header2</th>
<th>header3</th>
</tr>
</thead>
<tbody>
<tr>
<td>wartość</td>
<td>wartość</td>
<td>wartość</td>
</tr>
<tr>
<td>wartość</td>
<td>wartość</td>
<td>wartość</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>suma</td>
<td>suma</td>
<td>suma</td>
</tr>
</tfoot>
</table>
let table = document.querySelector('#table');
table.tHead.style.color = 'red';