Proprietà tHead

La proprietà tHead memorizza un riferimento al thead della tabella.

Sintassi

javascripttabella.tHead;

Esempio

Coloriamo in rosso l'intestazione della tabella:

html<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>totale</td>
      <td>totale</td>
      <td>totale</td>
    </tr>
  </tfoot>
</table>
javascriptlet table = document.querySelector('#table');
table.tHead.style.color = 'red';

Vedi anche

  • proprietà tFoot,
    che contiene il tfoot della tabella
  • proprietà tBodies,
    che contiene il tbody della tabella
  • proprietà rows,
    che contiene le righe della tabella
  • proprietà cells,
    che contiene le celle della tabella