HTML záhlaví Atribut


Definice a použití

Atribut headersurčuje jednu nebo více buněk záhlaví, ke kterým se buňka tabulky vztahuje.


Platí pro

Atribut headerslze použít u následujících prvků:

Prvky Atribut
<td> hlavičky
<th> hlavičky

Příklady

Příklad Td

Zadejte prvek <th>, ke kterému se každý prvek <td> vztahuje:

<table>
  <tr>
    <th id="name">Name</th>
    <th id="email">Email</th>
    <th id="phone">Phone</th>
    <th id="addr">Address</th>
  </tr>
  <tr>
    <td headers="name">John Doe</td>
    <td headers="email">[email protected]</td>
    <td headers="phone">+45342323</td>
    <td headers="addr">Rosevn 56,4300 Sandnes,Norway</td>
  </tr>
</table>

Příklad

Zadejte prvek <th>, ke kterému se vztahuje každá buňka záhlaví:

<table>
  <tr>
    <th id="name" colspan="2">Name</th>
  </tr>
  <tr>
    <th headers="name">Firsname</th>
    <th headers="name">Lastname</th>
  </tr>
</table>

Podpora prohlížeče

Atribut headersmá následující podporu prohlížeče pro každý prvek:

Element
td Yes Yes Yes Yes Yes
th Yes Yes Yes Yes Yes