如何以正确的方式用javascript填充表?
function loadTableData() {
//0: Date
//1: Name
var row = document.getElementById("test");
var x = row.insertCell(0);
x.innerHTML = "10/17/2018";
var x = row.insertCell(1);
x.innerHTML = "john doe";
}
<table id="myTable" class="table table-borderless table-striped table-earning">
<thead>
<tr>
<th>date</th>
<th>file name</th>
</tr>
</thead>
<tbody>
<tr id="test"></tr>
</tbody>
</table>
<script>loadTableData();</script>
我的当前代码填充了前两个单元格,但我想移动到下一列并填充另外两个单元格。我不知道怎么做才是正确的。
电流输出
https://stackoverflow.com/questions/52919972
复制相似问题