jQuery add and add

前端 未结 3 632
既然无缘
既然无缘 2021-01-05 10:03

How do I add and this using jQuery?

the problem is my table has 1 or 2 th rows?

$(\'#myTable tr         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 10:43

    use wrapAll instead of wrap

    $('#myTable tr:has(th)').wrapAll('');​
    $("#myTable thead").prependTo("#myTable")
    

提交回复
热议问题