TableRow sectionRowIndex Property

Definition and Usage

sectionRowIndex Property returns the position of the row in <tbody>, <thead> or <tfoot>: Samling af rækker på denne placering.

See also:

HTML Reference Manual:HTML <tr> tag

Instance

Example 1

Click on different rows to output their positions:

alert("Section row index is: " + x.sectionRowIndex);

Prøv det selv

Example 2

Return the position of rows in the thead, tbody and tfoot collections:

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>";
}

Prøv det selv

Syntaks

Retur sectionRowIndex egenskab:

tablerowObject.sectionRowIndex

Tekniske detaljer

Returværdi: etal, der repræsenterer rækken i tbody, thead eller tfoot Samling af rækker på denne placering.

Browser support

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