I have an HTML table with a header and a footer:
<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>
I am trying to add a row in tbody
with the following:
myTable.insertRow(myTable.rows.length - 1);
but the row is added in the tfoot
section.
How do I insert tbody
?