如何使用jQuery在动画表中添加新行?

Rak*_*yal 4 html jquery

这就是我在表中添加新行的方法: -

function expandAll(){
        $('#myTableID>tbody>tr>td:nth-child(2)>div:nth-child(2)').each ( function() {
            html = $(this).html();
// Is it possible to add this Row with animation
            $(this).parent().parent().after( "<tr><td colspan='2'>&nbsp;</td><td colspan='15'>" + html + "</td></tr>" ).slideDown('slow');          
        } );
    }
Run Code Online (Sandbox Code Playgroud)

我可以添加新的Row,但是没有使用slideDown的效果.

Der*_*huk 6

如果你有JQuery 1.3.2,你可以这样做:

$("<your row html>").hide().insertAfter($(this).parent().parent()).slideDown('slow');
Run Code Online (Sandbox Code Playgroud)