The DOM is slow; you want to avoid manipulating it as much as
possible. jQuery introduced $.fn.detach
in version 1.4 to
help address this issue, allowing you to remove an element from the DOM
while you work with it.
var $table = $('#myTable'); var $parent = table.parent(); $table.detach(); // ... add lots and lots of rows to table $parent.append(table);
Copyright Rebecca Murphey, released under the Creative Commons Attribution-Share Alike 3.0 United States license.