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

HTML DOM TableHeader rowSpan property

TableHeader rowSpan property

TableHeader Object Reference The TableHeader object

Example

Change the number of rows a cell spans:

document.getElementById("myTh").rowSpan="1";

Try it »


Definition and Usage

The rowSpan property sets or returns the value of the rowspan property.

The rowspan property specifies the number of rows a table cell can span.

**Tip:** Use colSpan Property used to set or return the value of the colspan property.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the rowSpan property.


Syntax

Return the rowSpan property:

tableheaderObject

.rowSpan

Set the rowSpan property:

tableheaderObject

.rowSpan=

number

Attribute values

Value Description
number Specifies the number of rows a cell can span.

Technical Details

Return Value: 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;

x The output is:

2

Try it »


Related Articles

HTML Reference Manual:HTML rowspan property


TableHeader Object Reference The TableHeader object