Check if there is a prexisting tfoot, before creating a new one.
[lhc/web/wiklou.git] / resources / jquery / jquery.tablesorter.js
index c988612..76ab215 100644 (file)
                                                        // and put the <tfoot> at the end of the <table>
                                                        var $sortbottoms = $table.find( 'tr.sortbottom' );
                                                        if ( $sortbottoms.length ) {
-                                                               $table.append( $( '<tfoot>' ).append( $sortbottoms ) )
+                                                               var $tfoot = $table.find( 'tfoot' );
+                                                               if( $tfoot ) {
+                                                                       $tfoot.eq(0).prepend( $sortbottoms );
+                                                               } else {
+                                                                       $table.append( $( '<tfoot>' ).append( $sortbottoms ) )
+                                                               }
                                                        }
 
                                                        explodeRowspans( $table );