Attributo HTML <th> colspan
Esempio
Una tabella HTML con una cella di intestazione che si estende su due colonne:
<table>
<tr>
<th colspan="2">Monthly Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Definizione e utilizzo
L' colspan
attributo definisce il numero di colonne su cui una cella di intestazione deve occupare.
Supporto 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
<th colspan="number">
Valori di attributo
Value | Description |
---|---|
number | Sets the number of columns a header cell should span. Note: colspan="0" tells the browser to span the cell to the last column of the column group (colgroup) |
❮ Tag HTML <th>