How to split a table row with jQuery (insert TR between TD's)

前端 未结 3 668
独厮守ぢ
独厮守ぢ 2021-01-14 18:25

I have some problem splitting a table with jQuery.

This is the table:

").insertAfter(boundary.parent()).append(boundary.nextAll().andSelf());
});

DEMO

提交回复
热议问题
3条回答
  •  春和景丽
    2021-01-14 18:59

    This code solve the problem of yours.

    enter image description here

    $(document).ready(function(){  
         $("table tr td:nth-child(5n)").addClass('break');
        var boundary = $("td.break");
        $("