}
$thead.append( this );
} );
- $table.find( ' > tbody:first' ).before( $thead );
+ $table.find( ' > tbody' ).first().before( $thead );
}
if ( !$table.get( 0 ).tFoot ) {
$tfoot = $( '<tfoot>' );
headerIndex,
exploded,
$tableHeaders = $( [] ),
- $tableRows = $( 'thead:eq(0) > tr', table );
+ $tableRows = $( table ).find( 'thead' ).eq( 0 ).find( '> tr' );
if ( $tableRows.length <= 1 ) {
$tableHeaders = $tableRows.children( 'th' );