TableRow sectionRowIndex 屬性
描述
<tbody>、<thead> 或 <tfoot> 的 rows 集合中行的位置。
瀏覽器支援
屬性 | |||||
---|---|---|---|---|---|
sectionRowIndex | 是 | 是 | 是 | 是 | 是 |
語法
返回 sectionRowIndex 屬性
tablerowObject.sectionRowIndex
技術詳情
返回值 | 一個數字,表示行在 tbody、thead 或 tfoot 的 rows 集合中的位置 |
---|
更多示例
示例
返回 thead、tbody 和 tfoot 的 rows 集合中行的位置
var x = document.getElementsByTagName("tr");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "行 "+(i+1)+" 的索引是: "+x[i].sectionRowIndex+"<br>";
}
自己動手試一試 »
❮ TableRow 物件