Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript looping through table

var table = document.getElementById("myTable");
for (let i in table.rows) {
   let row = table.rows[i]
   //iterate through rows
   //rows would be accessed using the "row" variable assigned in the for loop
   for (let j in row.cells) {
     let col = row.cells[j]
     //iterate through columns
     //columns would be accessed using the "col" variable assigned in the for loop
   }  
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Javascript #looping #table
ADD COMMENT
Topic
Name
4+6 =