Attributo HTML <td> colspan

❮ Tag HTML <td>

Esempio

Una tabella HTML con una cella di tabella che si estende su due colonne:

<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>

Definizione e utilizzo

L' colspanattributo definisce il numero di colonne su cui una cella deve occupare.


Supporto del browser

Attribute
colspan Yes Yes Yes Yes Yes

Nota: solo Firefox supporta colspan="0", che ha un significato speciale (guarda sotto nella tabella "Valori degli attributi").


Sintassi

<td colspan="number">

Valori di attributo

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)

❮ Tag HTML <td>