9
JavaScript에서 HTML 테이블 본문에 행을 삽입하는 방법
머리글과 바닥 글이있는 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합니까?