From 636ef9c65a4757dda04288b07a226ea06e7bc962 Mon Sep 17 00:00:00 2001 From: Mottie Date: Wed, 9 Oct 2013 20:54:46 -0500 Subject: [PATCH] Only visible columns will be considered when fixing column widths. Fixes #371 --- js/jquery.tablesorter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 236d8ed9..32bba677 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -497,7 +497,8 @@ if (table.config.widthFixed && $(table).find('colgroup').length === 0) { var colgroup = $(''), overallWidth = $(table).width(); - $(table.tBodies[0]).find("tr:first").children("td").each(function() { + // only add col for visible columns - fixes #371 + $(table.tBodies[0]).find("tr:first").children("td:visible").each(function() { colgroup.append($('').css('width', parseInt(($(this).width()/overallWidth)*1000, 10)/10 + '%')); }); $(table).prepend(colgroup);