Set the background color of the first two columns to red:
document.getElementById("myCol").span = "2";
document.getElementById("myCol").style.backgroundColor = "red";
The span property sets or returns the value of the span attribute of a column.
The span attribute defines the number of columns a <col> element should span.
Property | |||||
---|---|---|---|---|---|
span | Yes | Yes | Yes | Yes | Yes |
Return the span property:
columnObject.span
Set the formMethod property:
columnObject.span = number
Value | Description |
---|---|
number | Specifies the number of columns a <col> element should span. Negative values are not allowed |
Return Value: | A Number, representing the number of columns |
---|
Return the number of columns a <col> element should span:
var x = document.getElementById("myCol").span;
HTML reference: HTML <col> span attribute