Example
Click on different rows to alert their position:
alert("Section row index is: " + x.sectionRowIndex);
Try it Yourself »
Definition and Usage
The sectionRowIndex property returns the position of a row in the rows collection of a <tbody>, <thead>, or <tfoot>.
Browser Support
The sectionRowIndex property is supported in all major browsers.
Syntax
Return the sectionRowIndex property:
tablerowObject.sectionRowIndex
Technical Details
Return Value: | A Number, representing the position of the row in the rows collection of a tbody, thead, or tfoot |
---|
More Examples
Example
Return the position of the rows in the thead, tbody, and tfoot rows collection:
var x = document.getElementsByTagName("tr");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "The index of Row
"+(i+1)+" is: "+x[i].sectionRowIndex+"<br>";
}
Try it Yourself »
< TableRow Object