Column span properties
Examples
Back <col> number (ie span value) across a column element:
var x = document.getElementById("myCol").span;
x The output is:
2
try it"
Definitions and use
span span property sets or returns the property value column.
span attribute set the <col> element number of columns spanned.
Browser Support
All major browsers support span property.
grammar
Returns span attributes:
columnObject .span
Setting formMethod properties:
columnObject .span= number
Property Value
值 | 描述 |
---|---|
number | 描述了<col> 元素横跨的列数 |
Technical Description
return value: | A number that represents the number of columns |
---|
More examples
Examples
Use span and backgroundColor property is set before the two background color to red:
document.getElementById("myCol").span="2";
document.getElementById("myCol").style.backgroundColor="red";
document.getElementById("myCol").style.backgroundColor="red";
try it"
Related Pages
HTML Reference Manual: HTML <COL> span properties