HTML <td> colspan- Attribut
Beispiel
Eine HTML-Tabelle mit einer Tabellenzelle, die sich über zwei Spalten erstreckt:
<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>
Definition und Verwendung
Das colspan
Attribut definiert die Anzahl der Spalten, die eine Zelle umfassen soll.
Browser-Unterstützung
Attribute | |||||
---|---|---|---|---|---|
colspan | Yes | Yes | Yes | Yes | Yes |
Hinweis: Nur Firefox unterstützt colspan="0"
, was eine besondere Bedeutung hat (siehe unten in der Tabelle "Attributwerte").
Syntax
<td colspan="number">
Attributwerte
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) |
❮ HTML <td>-Tag