append row after first row in a html table

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

I have var row=valval2 and I tried this:

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


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 09:21

    Try this:

    $("#mainTable tr:first").after(row);
    

    http://api.jquery.com/after/

提交回复
热议问题