Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM td/th colSpan property

td/th colSpan property

td/th Object Reference td/th object


Definition and Usage

The colSpan property sets or returns the number of columns a cell spans.

Syntax

Set the colSpan property:

tdObject.colSpan="

number

"

or

thObject.colSpan="

number

"

Return the colSpan property:

tdObject.colSpan

or

thObject.colSpan

Tip: There is no default value for the colSpan property.

Value Description
number Defines the number of columns spanned

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the colSpan property


Example

Example

The following example changes the number of columns a cell spans:

Runoob Tutorial(runoob.com)

    

        

        

    

    

        

        

    

    

        

        

    

    

        

        

    

Month Deposit
January $100.00
February $10.00
March $80.00

Try it »


td/th Object Reference td/th object