Please see my comment to the question. Actually use jQuery, not just tag it:
http://api.jquery.com/category/traversing.
Another idea: if you already know the structure (how many cells per row, first of all), you can simply take all the
<td>
elements and iterate through the set:
var allCells = $("td");
allCells.each(function(index){
})
Please see:
https://api.jquery.com/each,
not to be confused with
https://api.jquery.com/jquery.each.
If you have more than one table on the page, use more complex
selector. See for example:
https://api.jquery.com/multiple-selector.
This is all really simple.
—SA