1var table = document.getElementById("mytab1");
2for (var i = 0, row; row = table.rows[i]; i++) {
3 //iterate through rows
4 //rows would be accessed using the "row" variable assigned in the for loop
5 for (var j = 0, col; col = row.cells[j]; j++) {
6 //iterate through columns
7 //columns would be accessed using the "col" variable assigned in the for loop
8 }
9}
10