TableHeader rowSpanProperty
Example
Change the number of rows a cell spans:
document.getElementById("myTh").rowSpan="1";
Try it yourself »
Definition and Usage
The rowSpan property sets or returns the value of the rowspan attribute.
The rowspan attribute specifies the number of rows a table cell can span.
Tip:Use thecolSpanproperty to set or return the value of the colspan attribute.
Browser Support
![]()
All major browsers support the rowSpan property.
Syntax
Return the rowSpan property:
tableheaderObject.rowSpan
Set the rowSpan property:
tableheaderObject.rowSpan=number
Property Value
| Value | Description |
|---|---|
| number | Specifies the number of rows a cell can span. |
Technical Details
| Return Value: | A number, representing the number of rows a table cell can span. |
|---|
More Examples
Example
Return the number of rows a specified table cell can span:
var x = document.getElementById("myTh").rowSpan;
document.getElementById("demo").innerHTML=x;
document.getElementById("demo").innerHTML=x;
xThe output result is:
2
Try it yourself »
Related Articles
HTML Reference:HTML <th> rowspan Attribute
Other Extensions
TableHeader Object