Les tableaux - Cinquième Partie : thead, th, tfoot, tbody
Pour définir l'entête, le corps et le pied du tableau vous devez utiliser les balises <thead>, <tfoot>, et <tbody> dans cet ordre. Noter que la balise <thead> s'utilise avec <th>. La balise <th> sert à marquer un entête de colonne, le texte entre ces balises sera mis en valeur (en gras la plupart du temps) :
<table border="1">
<thead>
<tr>
<th>Produit</th>
<th>Quantité</th>
<th>Prix</th>
<tr>
</thead>
<tfoot>
<tr>
<td>Totale</td>
<td>25</td>
<td>25€</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Pomme</td>
<td>7</td>
<td>12€</td>
</tr>
<tr>
<td>Orange</td>
<td>13</td>
<td>8€</td>
</tr>
<tr>
<td>Pamplemousse</td>
<td>10</td>
<td>10€</td>
</tr>
</tbody>
</table>
Vous pouvez aussi définir un entête de colonne sans utiliser <thead>, <tfoot>, <tbody> :
<table>
<tr>
<th>..</th>
<th>..</th>
</tr>
<tr>
<td>..</td>
<td>..</td>
</tr>
</table>
Pour les attributs, même chose que pour les autres balises : align, valign, id, class, style.