我是新人,仍在学习:我已经创建了 HTML 表格,但布局有问题。当我复制表格时,它会弄乱我的布局,看看编号为 2 的表格,表格应该看起来相同:第二个表格应该看起来像表格编号 1
var tbody = document.querySelector('tbody');
var thscoped = document.querySelector('tbody .sem');
var count = 0;
for (var ch = tbody.firstChild; ch; ch = ch.nextSibling)
if (ch instanceof HTMLElement) count++;
thscoped.setAttribute("rowspan", count);
.sem {
border:1px solid red
}
有人能帮我解决这个问题吗?
汪汪一只猫
尚方宝剑之说
相关分类