HTML DOM TableHeader rowSpan property
Examples
Change the number of rows spanned by a cell:
document.getElementById("myTh").rowSpan="1";
try it"
Definition and Usage
rowSpan property sets or returns the value of the rowspan attribute.
rowspan attribute specifies the number of rows in a table cell can be spanned.
Tip: Use colSpan property to set or return colspan attribute values.
Browser Support
All major browsers support rowSpan property.
grammar
Back rowSpan properties:
tableheaderObject .rowSpan
Setting rowSpan properties:
tableheaderObject .rowSpan=number
Property Value
值 | 描述 |
---|---|
number | 规定一个单元格可横跨的行数。 |
technical details
return value: | Number representing the number of rows in a table cell can be spanned. |
---|
More examples
Examples
Returns a specified number of rows in a table cell can be spanned:
var x = document.getElementById("myTh").rowSpan;
document.getElementById("demo").innerHTML=x;
document.getElementById("demo").innerHTML=x;
x The output is:
2
try it"
related articles
HTML Reference Manual: HTML <TH> rowspan attributes