td/th colSpan property
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





All major browsers support the colSpan property
Example
Example
The following example changes the number of columns a cell spans:
| Month | Deposit |
|---|---|
| January | $100.00 |
| February | $10.00 |
| March | $80.00 |
Try it »
td/th object