Easy Tutorial
❮ Prop Style Widows Prop Pushbutton Type ❯

TableHeader colSpan Attribute

TableHeader Object

Example

Change the number of columns a cell spans:


Definition and Usage

The colSpan property sets or returns the value of the colspan attribute.

The colspan attribute specifies the number of columns a table cell can span.

Tip: Use the rowSpan property to set or return the value of the rowspan attribute.


Browser Support

All major browsers support the colSpan property.


Syntax

Return the colSpan property:

Set the colSpan property:

Property Values

Value Description
number Specifies the number of columns a cell can span.

Technical Details

| Return Value: | Number, representing the number of columns a table cell can span. | | --- | --- |


More Examples

Example

Return the number of columns a specified table cell can span:

x Output result is:


Related Articles

HTML Reference: HTML <th> colspan Attribute


TableHeader Object

❮ Prop Style Widows Prop Pushbutton Type ❯