TableRowsectionRowIndexプロパティ_
例
別の行をクリックして、それらの位置を警告します。
alert("Section row index is: " + x.sectionRowIndex);
定義と使用法
sectionRowIndexプロパティは、<tbody>、<thead>、または<tfoot>の行コレクション内の行の位置を返します。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
sectionRowIndex | Yes | Yes | Yes | Yes | Yes |
構文
sectionRowIndexプロパティを返します。
tablerowObject.sectionRowIndex
技術的な詳細
戻り値: | tbody、thead、またはtfootの行コレクション内の行の位置を表す数値。 |
---|
その他の例
例
thead、tbody、およびtfoot行コレクションの行の位置を返します。
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>";
}
❮TableRowオブジェクト