jQuery - Clone table header to the bottom of table

jQuery - Clone table header to the bottom of table

jQuery - Clone table header to the bottom of table

For a better readability of your tables, it can be a good idea to clone the table header on the bottom of the table. This is what this useful snippet do.

var $tfoot = $('<tfoot></tfoot>');
$($('thead').clone(true, true).children().get().reverse()).each(function(){
    $tfoot.append($(this));
    });
$tfoot.insertAfter('table thead');

Source: http://lunart.com.ua/jquery