Specifications
- HTML 3.2
colspan
This takes a positive integer value specifying the number of columns spanned by this cell. It defaults to one.
- RFC 1942-HTML Tables
COLSPAN, e.g. <TD COLSPAN=2>
A positive integer value that defines how may columns this cell
spans. The default COLSPAN is 1. COLSPAN=0 has a special
significance and implies that the cell spans all columns from
the current column up to the last column of the table.
- HTML 4.01 / XHTML 2.0
colspan = number [CN]
This attribute specifies the number of columns spanned by the current cell. The default value of this attribute is one ("1"). The value zero ("0") means that the cell spans all columns from the current column to the last column of the column group (COLGROUP) in which the cell is defined.
Bugs
Gecko (i.e. Firefox, Mozilla, etc.)
Gecko implements the RFC 1942 definition, it sets colspan=0 to table width, not by colgroup.
IE
IE implements the HTML 3.2 definition, it sets colspan=0 as colspan=1.
The fix on this page applies the HTML 4.01 definition on IE6
Undefined Colgroup
| ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
| colspan=0 |
| ---===--- | colspan=0 |
| ---===--- | ---===--- | colspan=0 |
| colspan=3 | ---===--- | colspan=0 |
| colspan=0 | ---===--- |
| colspan=0 | ---===--- | ---===--- |
| ---===--- | colspan=0 | ---===--- |
| colspan=2 | colspan=0 | colspan=2 |
| colspan=0 | colspan=0 |
Colgroups Defined by Span Attributes
| ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
| colspan=0 |
| ---===--- | ---===--- | ---===--- | ---===--- | colspan=0 |
| colspan=0 | ---===--- | ---===--- | ---===--- |
| colspan=0 | colspan=0 |
| colspan=0 | colspan=0 | ---===--- |
| ---===--- | colspan=0 | ---===--- | colspan=0 |
| colspan=2 | colspan=3 | ---===--- | colspan=0 |
| ---===--- | colspan=2 | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
Colgroups Defined by COLs
| ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
| colspan=0 |
| ---===--- | ---===--- | ---===--- | ---===--- | colspan=0 |
| colspan=0 | ---===--- | ---===--- | ---===--- |
| colspan=0 | colspan=0 |
| colspan=0 | colspan=0 | ---===--- |
| ---===--- | colspan=0 | ---===--- | colspan=0 |
| colspan=2 | colspan=3 | ---===--- | colspan=0 |
| ---===--- | colspan=2 | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
Colgroups Defined a Mix (Span Second)
| ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
| colspan=0 |
| ---===--- | ---===--- | ---===--- | ---===--- | colspan=0 |
| colspan=0 | ---===--- | ---===--- | ---===--- |
| colspan=0 | colspan=0 |
| colspan=0 | colspan=0 | ---===--- |
| ---===--- | colspan=0 | ---===--- | colspan=0 |
| colspan=2 | colspan=3 | ---===--- | colspan=0 |
| ---===--- | colspan=2 | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
Colgroups Defined a Mix (Span First)
| ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
| colspan=0 |
| ---===--- | ---===--- | ---===--- | ---===--- | colspan=0 |
| colspan=0 | ---===--- | ---===--- | ---===--- |
| colspan=0 | colspan=0 |
| colspan=0 | colspan=0 | ---===--- |
| ---===--- | colspan=0 | ---===--- | colspan=0 |
| colspan=2 | colspan=3 | ---===--- | colspan=0 |
| ---===--- | colspan=2 | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
Colgroups Defined by a Mix (Span, Cols, Span)
| ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
| colspan=0 |
| ---===--- | ---===--- | ---===--- | ---===--- | colspan=0 |
| colspan=0 | ---===--- | ---===--- | ---===--- |
| colspan=0 | colspan=0 |
| colspan=0 | colspan=0 | ---===--- |
| ---===--- | colspan=0 | ---===--- | colspan=0 |
| colspan=2 | colspan=3 | ---===--- | colspan=0 |
| ---===--- | colspan=2 | ---===--- | ---===--- | ---===--- | ---===--- | ---===--- |
Weird Anomaly / Related Bug
Notice on IE6 that on the tables with column groups defined, the 6th lines last cell is in the column group when span attributes define columns, but when COL elements define colgroups it is outside.
Details