HTML - Balise <thead>

La description

La balise HTML <thead> est utilisée pour ajouter un en-tête à un tableau. La balise thead est utilisée conjointement avec la balise tbody et la balise tfoot pour déterminer chaque partie du tableau (en-tête, pied de page, corps).

Exemple

<!DOCTYPE html>
<html>

   <head>
      <title>HTML thead Tag</title>
   </head>

   <body>
      <table style = "width:100%" border = "1">
         <thead>
            <tr>
               <td colspan = "4">This is the head of the table</td>
            </tr>
         </thead>
         
         <tfoot>
            <tr>
               <td colspan = "4">This is the foot of the table</td>
            </tr>
         </tfoot>
         
         <tbody>
            <tr>
               <td>Cell 1</td>
               <td>Cell 2</td>
               <td>Cell 3</td>
               <td>Cell 4</td>
            </tr>
            <tr>
               ...more rows here containing four cells...
            </tr>
         </tbody>
         
         <tbody>
            <tr>
               <td>Cell 1</td>
               <td>Cell 2</td>
               <td>Cell 3</td>
               <td>Cell 4</td>
            </tr>
            <tr>
               ...more rows here containing four cells...
            </tr>
         </tbody>
         
      </table>
   </body>

</html>

Cela produira le résultat suivant -

Attributs globaux

Cette balise prend en charge tous les attributs globaux décrits dans - Référence des attributs HTML

Attributs spécifiques

La balise HTML <thead> prend également en charge les attributs supplémentaires suivants -

Attribut Valeur La description
aligner centre droit
gauche justify char


Obsolète - Alignement visuel.
carboniser personnage Obsolète - Spécifie le caractère sur lequel aligner le texte. Utilisé lorsque align = "char"
Charoff pixels ou% Obsolète - Spécifie un décalage d'alignement (en pixels ou en pourcentage) par rapport au premier caractère comme spécifié avec l'attribut char. Utilisé lorsque align = "char"
valigné ligne de base en haut au
milieu en
bas
Obsolète - Alignement vertical.

Attributs d'événement

Cette balise prend en charge tous les attributs d'événement décrits dans - Référence des événements HTML

Prise en charge du navigateur

Chrome Firefox C'EST À DIRE Opéra Safari Android
Oui Oui Oui Oui Oui Oui