Add table row in jQuery

前端 未结 30 2318
既然无缘
既然无缘 2020-11-21 05:40

What is the best method in jQuery to add an additional row to a table as the last row?

Is this acceptable?

$(\'#myTable\').append(\'

        
30条回答
  •  遇见更好的自我
    2020-11-21 06:19

    
    

    You can cache the footer variable and reduce access to DOM (Note: may be it will be better to use a fake row instead of footer).

    var footer = $("#mytable tfoot")
    footer.before("")
    

提交回复
热议问题