HTML <col> spanAtributos
Ejemplos
Aquí, las dos primeras columnas tienen color de fondo rojo:
<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>
Pruébalo »
Soporte del navegador
![]()
![]()
![]()
![]()
![]()
Todos los navegadores principales admiten el atributo span.
Definición y uso
El atributo span especifica el número de columnas que el elemento col debe abarcar.
Diferencias entre HTML 4.01 y HTML5
NONE.
Sintaxis
<col span="number">
Valores de atributo
| Valor | Descripción |
|---|---|
| number | Establece el número de columnas que el elemento col debe abarcar. |
Etiqueta HTML <col> Otras extensiones