Attribut HTML <col> span

❮ Balise HTML <col>

Exemple

Ici, les deux premières colonnes doivent avoir une couleur de fond rouge :

<table>
  <colgroup>
    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
  </colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>

Définition et utilisation

L' spanattribut définit le nombre de colonnes qu'un <col>élément doit couvrir.


Prise en charge du navigateur

Attribute
span Yes Yes Yes Yes Yes

Syntaxe

<col span="number">

Valeurs d'attribut

Value Description
number Sets the number of columns a <col> element should span

❮ Balise HTML <col>