HTML DOM TableHeader rowSpan Property
THE WORLD'S LARGEST WEB DEVELOPER SITE

TableHeader rowSpan Property

❮ TableHeader Object

Example

Change the number of rows a cell should span:

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 should span.

Tip: Use the colSpan property to set or return the value of the colspan attribute.


Browser Support

Property
rowSpan Yes Yes Yes Yes Yes

Syntax

Return the rowSpan property:

tableheaderObject.rowSpan

Set the rowSpan property:

tableheaderObject.rowSpan = number

Property Values

Value Description
number Specifies the number of rows a cell should span


Technical Details

Return Value: A Number, representing the number of rows a table cell should span

More Examples

Example

Return the number of rows a specific table cell should span:

var x = document.getElementById("myTh").rowSpan;
Try it Yourself »

Related Pages

HTML reference: HTML <th> rowspan attribute


❮ TableHeader Object