TableRow sectionRowIndex eigenschap

Definitie en gebruik

sectionRowIndex Eigenschap retourneert de positie van de rij in <tbody>, <thead> of <tfoot>: Rows Collection Location.

Zie ook:

HTML referentiemanual:HTML <tr> Tag

Voorbeeld

Voorbeeld 1

Klik op verschillende rijen om hun posities weer te geven:

alert("Index van sectierij is: " + x.sectionRowIndex);

Try It Yourself

Voorbeeld 2

Retourneer de posities van de rows in de thead, tbody en tfoot sets:

var x = document.getElementsByTagName("tr");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
  txt = txt + "De index van Row "+(i+1)+" is: "+x[i].sectionRowIndex+"<br>";
}

Try It Yourself

Syntax

Returns the sectionRowIndex property:

tablerowObject.sectionRowIndex

Technical Details

Return value: A number representing the row's position in the tbody, thead, or tfoot. Rows Collection Location.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support