X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Column span Property

Column Object Reference Column Object

Example

Set the background color of the first two columns to red:

document.getElementById("myCol").span = "2";
document.getElementById("myCol").style.backgroundColor = "red";

Try it yourself »


Definition and Usage

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.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The span property is supported in all major browsers.


Syntax

Return the span property:

columnObject.span

Set the formMethod property:

columnObject.span=number

Property Values

Value Description
number Specifies the number of columns a <col> element should span. Negative values are not allowed

Technical Details

Return Value: A Number, representing the number of columns


More Examples

Example

Return the number of columns a <col> element should span:

var x = document.getElementById("myCol").span;

The result of x could be:

2

Try it yourself »


Related Pages

HTML reference: HTML <col> span attribute


Column Object Reference Column Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook