Answers for "how to iterate table rows in javascript"

0

how to iterate table rows in javascript

var table = document.getElementById("mytab1");
for (var i = 0, row; row = table.rows[i]; i++) {
   //iterate through rows
   //rows would be accessed using the "row" variable assigned in the for loop
   for (var j = 0, col; col = row.cells[j]; j++) {
     //iterate through columns
     //columns would be accessed using the "col" variable assigned in the for loop
   }  
}
Posted by: Guest on August-31-2021

Code answers related to "how to iterate table rows in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language