TableHeader colSpan attribute
Definition and usage
colSpan
Attribute sets or returns the value of the colspan attribute.
<th> colspan attribute Specify the number of columns the table cell should span.
Tip:Use rowSpan attribute Set or return rowspan attribute value.
See also:
HTML Reference Manual:HTML <th> Tag
Example
Example 1
Change the number of columns the cell should span:
document.getElementById("myTh").colSpan = "1";
Example 2
Return the specific number of columns the table cell should span:
var x = document.getElementById("myTh").colSpan;
Syntax
Return colSpan attribute:
tableheaderObject.colSpan
Set colSpan attribute:
tableheaderObject.colSpan = number
Attribute Value
Value | Description |
---|---|
number | Specifies the number of columns the cell should span. |
Technical Details
Return Value: | Number, indicating the number of columns the table cell should span. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <th> colspan Attribute