tr sectionRowIndex 属性

tr 对象参考手册 tr 对象

定义和用法

TsectionRowIndex 属性返回某一行在TBODY,THEAD,或TFOOT rows 集合中的位置

语法

返回 sectionRowIndex 属性:

trObject.sectionRowIndex

提示: sectionRowIndex 属性没有默认值。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流浏览器都支持 sectionRowIndex 属性


实例

实例

弹出THEAD,TBODY,tFoot Rows集合的行的位置:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本站教程(icodebang.com)</title>
<script>
function displayResult(x){
    alert("Section row index is: " + x.sectionRowIndex);
}
</script>
</head>
<body>

<table border="1">
    <thead>
        <tr onclick="displayResult(this)">
            <th>单击显示行下标</th>
        </tr>
        <tr onclick="displayResult(this)">
        <th>单击显示行下标</th>
        </tr>
</thead>
<tbody>
        <tr onclick="displayResult(this)">
        <td>单击显示行下标</td>
        </tr>
        <tr onclick="displayResult(this)">
        <td>单击显示行下标</td>
        </tr>
</tbody>
<tfoot>
        <tr onclick="displayResult(this)">
        <td>单击显示行下标</td>
        </tr>
        <tr onclick="displayResult(this)">
        <td>单击显示行下标</td>
        </tr>
</tfoot>
</table>

</body>
</html>

尝试一下 »


tr 对象参考手册 tr 对象

0 个评论

要回复文章请先登录注册