English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The colspan attribute defines the number of columns the cell should span.
An HTML table with a cell spanning two columns:
<table style="width:100%;" border="1"> <tr> <th>Course</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 ‹/›
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).
The colspan attribute defines the number of columns the cell should span.
None.
<td colspan="number">
Value | Description |
---|---|
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). |