Set the background color of the first two columns to red:
The span property sets or returns the value of the span attribute of a column group.
The span attribute defines the number of columns a <colgroup> element should span.
Tip: To specify different properties to a column within a <colgroup>, use the Column object.
The span property is supported in all major browsers.
Return the span property:
Set the formMethod property:
Value | Description |
---|---|
number | Specifies the number of columns a <colgroup> element should span |
Return Value: | A Number, representing the number of columns |
---|
Return the number of columns a <colgroup> element should span:
The result of x could be:
HTML reference: HTML <colgroup> span attribute