Attributo delle intestazioni HTML
Definizione e utilizzo
L' headers
attributo specifica una o più celle di intestazione a cui è correlata una cella di tabella.
Si applica a
L' headers
attributo può essere utilizzato sui seguenti elementi:
Elementi | Attributo |
---|---|
<td> | intestazioni |
<i> | intestazioni |
Esempi
Td Esempio
Specificare l'elemento <th> a cui ogni elemento <td> è correlato:
<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>
L'esempio
Specificare l'elemento <th> a cui ogni cella di intestazione è correlata:
<table>
<tr>
<th id="name" colspan="2">Name</th>
</tr>
<tr>
<th headers="name">Firsname</th>
<th headers="name">Lastname</th>
</tr>
</table>
Supporto browser
L' headers
attributo ha il seguente supporto del browser per ogni elemento:
Element | |||||
---|---|---|---|---|---|
td | Yes | Yes | Yes | Yes | Yes |
th | Yes | Yes | Yes | Yes | Yes |