TableHeader rowSpan attribute

Definition and usage

rowSpan Attribute sets or returns the value of the rowspan attribute.

<th> rowspan attribute Specify the number of rows a table cell should span.

Tip:Use colSpan attribute Set or return colspan attribute value.

See also:

HTML Reference Manual:HTML <th> Tag

Example

Example 1

Change the number of rows a cell should span:

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

Try it yourself

Example 2

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

var x = document.getElementById("myTh").rowSpan;

Try it yourself

Syntax

Return the rowSpan attribute:

tableheaderObject.rowSpan

Set the rowSpan attribute:

tableheaderObject.rowSpan = number

Attribute Value

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

Technical Details

Return Value: Number, indicating the number of rows 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> rowspan Attribute