Easy Tutorial
❮ Jsref Fontsize Dom Obj Month ❯

Column span Attribute

Column Object

Example

Returns the number of columns spanned by a <col> element (i.e., the value of span):

x Output result:

2

Definition and Usage

The span attribute is used to set or return the value of the span attribute of a column.

The span attribute defines the number of columns spanned by a <col> element.


Browser Support

All major browsers support the span attribute.


Syntax

Return the span attribute:

Set the formMethod attribute:

Attribute Values

Value Description
number Describes the number of columns spanned by a <col> element

Technical Description

| Return Value: | A number representing the number of columns | | --- | --- |


More Examples

Example

Using the span and backgroundColor attributes to set the background color of the first two columns to red:


Related Pages

HTML Reference: HTML <col> span Attribute


Column Object

❮ Jsref Fontsize Dom Obj Month ❯