TableRow sectionRowIndex attribute

Paglilinaw at paggamit

sectionRowIndex Ang attribute ay ibabalik ang posisyon ng linya sa <tbody>, <thead> o <tfoot>. Rows Collection Location.

Mga iba pang sanggunian:

Manwal sa HTML:HTML <tr> Tag

Mga halimbawa

Halimbawa 1

I-click ang iba't ibang linya, ipakita ang kanilang posisyon:

alert("Ang index ng section row ay: " + x.sectionRowIndex);

Try It Yourself

Halimbawa 2

ibabalik ang posisyon ng rows sa collection ng thead, tbody at tfoot:

mag-isa x = document.getElementsByTagName("tr");
mag-isa txt = "";
mag-isa i;
mag-isa (i = 0; i < x.length; i++) {
  txt = txt + "Ang index ng Row "+(i+1)+" ay: "+x[i].sectionRowIndex+"<br>";
}

Try It Yourself

Syntax

Returns the sectionRowIndex property:

tablerowObject.sectionRowIndex

Technical Details

Return Value: Numeric value representing the position of the row in tbody, thead, or tfoot. Rows Collection Location.

Browser Support

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