TableRow sectionRowIndex property

Definition and Usage

sectionRowIndex Property returns the position of the row in <tbody>, <thead> or <tfoot>: Maktaba ya rows kiwango cha eneo.

See also:

HTML Reference Manual:HTML <tr> kitambaa

Instance

Example 1

Click on different rows to output their positions:

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

Jifunze kwa uangalifu

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

Jifunze kwa uangalifu

Mabati

Kuonesha uga sectionRowIndex:

tablerowObject.sectionRowIndex

Mifano ya teknolojia

Matokeo: Adhimisho, inaonyesha eneo la mji katika tbody, thead au tfoot. Maktaba ya rows kiwango cha eneo.

Matumizi ya wasaidizi wa mifumo

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Msaada Msaada Msaada Msaada Msaada