Wie füge ich eine Zeile in einen HTML-Tabellenkörper in Javascript ein?
Ich habe eine HTML-Tabelle mit Kopf- und Fußzeile:
<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>
Ich versuche, eine Zeile hinzuzufügentbody
mit den folgenden:
myTable.insertRow(myTable.rows.length - 1);
aber die zeile wird in dertfoot
Sektion.
Wie man es einfügttbody
?