标签:row cell col innertext 遍历 pre i++ code class
var table = document.getElementsByTagName("table")[0]; //遍历列 for (var i = 0; i < table.rows[0].cells.length; i++) { console.log(table.rows[0].cells[i].innerText); if (!table.rows[0].cells[i].innerText) { } } //遍历行 for (var i = 0; i < table.rows.length; i++) { var row = table.rows[i]; console.log(row.cells[0].innerText); }
标签:row cell col innertext 遍历 pre i++ code class
原文地址:https://www.cnblogs.com/guxingy/p/9680743.html