【发布时间】:2013-08-22 09:48:06
【问题描述】:
我有一个带有页眉和页脚的 HTML 表格:
<table id="myTable">
<thead>
<tr>
<th>My Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>aaaaa</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>My footer</td>
</tr>
<tfoot>
</table>
我正在尝试使用以下内容在 tbody 中添加一行:
myTable.insertRow(myTable.rows.length - 1);
但该行已添加到 tfoot 部分中。
如何插入tbody?
【问题讨论】:
标签: javascript html html-table insert row