append row after first row in a html table

后端 未结 3 1627
臣服心动
臣服心动 2021-02-02 09:00

I have var row=valval2 and I tried this:

$(\"#mainTable tbody\").append(row);
         


        
3条回答
  •  长情又很酷
    2021-02-02 09:30

    You can use prepend JQuery method that inserts as the first child:

    $("#mainTable tbody").prepend(row);
    

    Prepend documentation

提交回复
热议问题