📌  相关文章
📜  Javascript 循环遍历表 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.687000             🧑  作者: Mango

代码示例1
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
   }  
}