X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

TableRow sectionRowIndex Property

TableRow Object Reference TableRow Object

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

Internet Explorer Firefox Opera Google Chrome Safari

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>";
}
document.getElementById("demo").innerHTML = txt;

Try it yourself »


TableRow Object Reference TableRow Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook