Atributo HTML <td> colspan

❮ Etiqueta HTML <td>

Ejemplo

Una tabla HTML con una celda de tabla que abarca dos columnas:

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
  <tr>
    <td colspan="2">Sum: $180</td>
  </tr>
</table>

Definición y uso

El colspanatributo define el número de columnas que debe abarcar una celda.


Compatibilidad con navegador

Attribute
colspan Yes Yes Yes Yes Yes

Nota: Solo Firefox admite colspan="0", que tiene un significado especial (consulte a continuación en la tabla "Valores de atributos").


Sintaxis

<td colspan="number">

Valores de atributo

Value Description
number Specifies the number of columns a cell should span. Note: colspan="0" tells the browser to span the cell to the last column of the column group (colgroup)

❮ Etiqueta HTML <td>