HTML propriétés col span
Exemples
Ici, les deux premières colonnes couleur de fond au rouge:
<table border="1">
<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>
<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>
Essayez »
support du navigateur
Tous les principaux navigateurs prennent en charge la propriété span.
Définition et utilisation
attribut durée spécifie le nombre de colonnes de l'élément de col doit enjamber.
Différences entre HTML 4.01 et HTML5
NONE.
grammaire
<col span="number">
Valeur de la propriété
值 | 描述 |
---|---|
number | 设置 col 元素应该横跨的列数。 |
HTML <col> tag