We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


Jump to:

« tableRow

The HTMLTableRowElement.rowIndex property represents the position of a row in relation to the whole table.

Even when the thead, tbody, and tfoot elements are out of order in the HTML, all main browsers (Chrome, Safari, Firefox, Internet Explorer) except Opera render the table in the right order. Therefore the rows count from thead to tbody, from tbody to tfoot. Opera will give the rowIndex value accordingly to their position within the HTML.


			<td>Top Sirloin</td>

Showing the rowIndex value:

var rows = document.getElementsByTagName('tr');

for(var x = 0, xLength = rows.length; x < xLength; x++) {

  alert('rowIndex=' + rows[x].rowIndex);


Document Tags and Contributors

Last updated by: teoli,