Easy Tutorial
❮ Met Console Time Prop Video Width ❯

Columngroup span Attribute

Columngroup Object

Example

Return the number of columns spanned by the <colgroup> element:

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

x output result:


Definition and Usage

The span attribute sets or returns the value of the span attribute of a column group.

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

Tip: To describe the attributes of different column elements within a <colgroup>, use the Column object.


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 the <colgroup> element.

Technical Description

| Return Value: | Returns the number of columns | | --- | --- |


More Examples

Example

Set the background color of the first two columns to red using the span and backgroundColor attributes:


Related Pages

HTML Reference: HTML <colgroup> span Attribute


Columngroup Object

❮ Met Console Time Prop Video Width ❯