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 对象