TableRow sectionRowIndex Property
Example
Click on different rows to alert their position:
alert("Section row index is: " + x.sectionRowIndex);
Try it Yourself »
Description
The sectionRowIndex property returns the position of a row in the rows collection of a <tbody>, <thead>, or <tfoot>.
Browser Support
Property | |||||
---|---|---|---|---|---|
sectionRowIndex | Yes | Yes | Yes | Yes | Yes |
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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.