TableRow sectionRowIndex 属性

定义和用法

sectionRowIndex 属性返回行在 <tbody>、<thead> 或 <tfoot> 的 ชุด rows ตำแหน่ง

另请参阅:

HTML 参考手册:HTML <tr> แท็ก

实例

例子 1

点击不同的行,输出它们的位置:

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

ทดลองด้วยตัวเอง

例子 2

返回 thead、tbody 和 tfoot 的 rows 集合中行的位置:

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

ทดลองด้วยตัวเอง

รูปแบบ

คืนค่าพื้นที่ของ sectionRowIndex

tablerowObject.sectionRowIndex

รายละเอียดเทคนิค

ค่าที่คืนค่า ตัวเลข แสดงถึงบรรทัดใน tbody, thead หรือ tfoot ชุด rows ตำแหน่ง

การสนับสนุนเบราเซอร์

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
สนับสนุน สนับสนุน สนับสนุน สนับสนุน สนับสนุน