Atrybut colspan HTML <td>
Przykład
Tabela HTML z komórką tabeli, która obejmuje dwie kolumny:
<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>
Definicja i użycie
colspan
Atrybut określa liczbę kolumn, które powinna obejmować komórka .
Obsługa przeglądarki
Attribute | |||||
---|---|---|---|---|---|
colspan | Yes | Yes | Yes | Yes | Yes |
Uwaga: tylko Firefox obsługuje colspan="0"
, co ma specjalne znaczenie (spójrz poniżej w tabeli „Wartości atrybutów”).
Składnia
<td colspan="number">
Wartości atrybutów
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) |
❮ Znacznik HTML <td>