L'attribut headers

Description

L'attribut headers permet de faire la relation entre l'en-tête d'une colonne et les données de chaques cellules qui s'y réfèrent, dans un tableau. Il contient une liste d'id et fonctionne de paire avec cet attribut.

Compatibilité

Cet attribut est compatibles avec les balises <TD> et <TH>.
Idem en HTML5.

Exemple d'un tableau à deux colonnes

<table>
<tr>
<th id="t1">Titre 1</th>
<th id="t2">Titre 2</th>
</tr>
<tr>
<td headers="t1">Cell 1</td>
<td headers="t2">Cell 2</td>
</tr>
<tr>
<td headers="t1">Cell 3</td>
<td headers="t2">Cell 4</td>
</tr>
</table>
Titre 1 Titre 2
Cell 1 Cell 2
Cell 3 Cell 4