Column span attribute
Example
Return the number of columns spanned by the element (i.e., the value of span):
var x = document.getElementById("myCol").span;
x The output result is:
2
Try it »
Definition and usage
The span attribute is used to set or return the value of the column's span attribute.
The span attribute defines the number of columns spanned by the element.
Browser support

All major browsers support the span attribute.
Syntax
Return the span attribute:
columnObject
.span
Set the formMethod attribute:
columnObject
.span=
number
Attribute values
| Value | Description |
|---|---|
| number | describes |
Technical description
| Return value: | a number representing the column count |
|---|
More examples
Example
Use the span and backgroundColor attributes to set the background color of the first two columns to red:
document.getElementById("myCol").span="2";
document.getElementById("myCol").style.backgroundColor="red";
Try it »
Related pages
HTML Reference Manual: HTML span attribute
Column Object