colspan,
headerCount,
longestTR,
- matrixRowIndex,
- matrixColumnIndex,
exploded,
$tableHeaders = $( [] ),
$tableRows = $( 'thead:eq(0) > tr', table );
// Loop through all the dom cells of the thead
$tableRows.each( function ( rowIndex, row ) {
$.each( row.cells, function ( columnIndex, cell ) {
+ var matrixRowIndex,
+ matrixColumnIndex;
+
rowspan = Number( cell.rowSpan );
colspan = Number( cell.colSpan );
} );
// We want to find the row that has the most columns (ignoring colspan)
$.each( exploded, function ( index, cellArray ) {
- headerCount = $.unique( $( cellArray ) ).length;
+ headerCount = $( uniqueElements( cellArray ) ).filter( 'th' ).length;
if ( headerCount >= maxSeen ) {
maxSeen = headerCount;
longestTR = index;
}
} );
// We cannot use $.unique() here because it sorts into dom order, which is undesirable
- $tableHeaders = $( uniqueElements( exploded[longestTR] ) );
+ $tableHeaders = $( uniqueElements( exploded[longestTR] ) ).filter( 'th' );
}
// as each header can span over multiple columns (using colspan=N),