Get the row/column index of a table cell
It is surprising and annoying there is no easy way in html to get the accurate table row/column index of a cell if the table uses rowspan or colspan. This code does not reimplement the entire html spec’s algorithm because it is digusting but should work in all reasonable scenarios and the most common unreasonable scenarios: