From afe8d3b5385d6f6e094a745d86ad6fadf1a02d37 Mon Sep 17 00:00:00 2001 From: Mottie Date: Tue, 18 Mar 2014 17:56:48 -0500 Subject: [PATCH] column count now correct with nested tables + tfoot. Fixes #547 --- js/jquery.tablesorter.js | 2 +- js/jquery.tablesorter.widgets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 2b104199..4a624d7c 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -387,7 +387,7 @@ var matrix = [], lookup = {}, cols = 0, // determine the number of columns - trs = $(t).find('thead:eq(0), tfoot').children('tr'), // children tr in tfoot - see issue #196 + trs = $(t).children('thead, tfoot').children('tr'), // children tr in tfoot - see issue #196 & #547 i, j, k, l, c, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow; for (i = 0; i < trs.length; i++) { cells = trs[i].cells; diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 6d6b15e9..a4d243c6 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -680,7 +680,7 @@ ts.filter = { for (column = 0; column < columns; column++) { buildFilter += ''; } - c.$filters = $(buildFilter += '').appendTo( c.$table.find('thead').eq(0) ).find('td'); + c.$filters = $(buildFilter += '').appendTo( c.$table.children('thead').eq(0) ).find('td'); // build each filter input for (column = 0; column < columns; column++) { disabled = false;