span Attributespan AttributeThe span attribute can be used on
colgroup and col
elements to specify the number of columns to be spanned.
For a col element,
the span attribute specifies the number of columns to
be "spanned" by the element (default = 1). Any width attribute will then be
applied to each of the columns spanned - i.e. the following code
will span two adjacent columns and set each to be 40px in width (total width 80px):
<col span="2" width="40" />
For an empty colgroup
element, the span attribute specifies the number of columns in that
column group.
However, if there are any col elements within a colgroup,
its span attribute is ignored completely. Instead, the
span values (default = 1) of each of its col children are
added together to get the number of columns in the group. As was the
case with col, any width attribute on a
colgroup element will apply to each
column within the group, rather than to the group as a whole.
colgroup and col elements
(taking into account all relevant span attributes)
should always be equal to the actual number of columns in the
table as determined by the maximum number of cells in a row (taking into
account any colspan and rowspan attributes).span is "1", any colgroup elements
which have no col children and span only one column should be given an
explicit span="1" attribute. This is because an apparent bug in early versions of Safari
defaulted such column groups to a span of "0".