tr sectionRowIndex Property
tr Object
Definition and Usage
The sectionRowIndex property returns the position of a row in the rows collection of a
tbody,
thead, or tfoot.
Syntax
Return the sectionRowIndex property:
Tip: There is no default value for the sectionRowIndex property.
Browser Support

The sectionRowIndex property is supported in all major browsers.
Example
Example
Alert the position of the rows in the thead, tbody, and tfoot rows collection:
<html>
<head>
<script>
function displayResult(x)
{
alert("Section row index is: " + x.sectionRowIndex);
}
</script>
</head>
<body>
<table border="1">
<thead>
<tr onclick="displayResult(this)">
<th>Click to show sectionRowIndex</th>
</tr>
<tr onclick="displayResult(this)">
<th>Click to show sectionRowIndex</th>
</tr>
</thead>
<tbody>
<tr onclick="displayResult(this)">
<td>Click to show sectionRowIndex</td>
</tr>
<tr onclick="displayResult(this)">
<td>Click to show sectionRowIndex</td>
</tr>
</tbody>
<tfoot>
<tr onclick="displayResult(this)">
<td>Click to show sectionRowIndex</td>
</tr>
<tr onclick="displayResult(this)">
<td>Click to show sectionRowIndex</td>
</tr>
</tfoot>
</table>
</body>
</html>
Try it yourself »
tr Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]