English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Ganze Liste der HTML-Tags

HTML td colspan Eigenschaft

Die Eigenschaft colspan definiert die Anzahl der Spalten, die die Zelle überspannen soll.

 HTML <td> Tag

Online-Beispiel

Eine HTML-Tabelle mit einer Zelle, die über zwei Spalten hinausgeht:

<table style="Breite:100%;" border="1">
    <tr>
      <th>Lehre</th>
      <th>Price</th>
    </tr>
    <tr>
      <td>PHP Basic Course</td>
      <td align="char" char="." charoff="2">450.00</td>
    </tr>
    <tr>
      <td>Java Programming Course</td>
      <td align="char" char="." charoff="2">880.00</td>
    </tr>
    <tr>
    <td colspan="2">Total: 1330</td>
  </tr>
</table>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the colspan attribute.

Note:Only Firefox supports colspan="0", which has a special meaning (see the "Attribute Value" table below).

Definition and Usage

The colspan attribute defines the number of columns the cell should span.

HTML 4.01 with HTML5differences

None.

Syntax

<td colspan="number">

Attribute Value

ValueDescription
number

Specify the number of columns the cell should span.

Note: colspan="0" informs the browser to span the cell across to the last column of the column group (colgroup).

 HTML <td> Tag