From 99b674def88ba875f500c914fc6268fbefceffd9 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 12 May 2011 20:32:18 +0100 Subject: [PATCH] Fix: New algorithim for calculating the column widths for a table when x-scrolling is enabled. Basically browsers need a bit of a hand when a width is assigned to any columns when x-scrolling as they tend to collapse the table to the min-width, even if we sent the column widths. So we need to keep track of what the table width should be by summing the user given values, and the automatic values --- media/js/jquery.dataTables.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index c78cb027..a69978c5 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -5609,7 +5609,37 @@ { oNodes = _fnGetUniqueThs( oSettings, $('thead', nCalcTmp)[0] ); } + + /* Browsers need a bit of a hand when a width is assigned to any columns when + * x-scrolling as they tend to collapse the table to the min-width, even if + * we sent the column widths. So we need to keep track of what the table width + * should be by summing the user given values, and the automatic values + */ + if ( oSettings.oScroll.sX !== "" ) + { + var iTotal = 0; + iCorrector = 0; + for ( i=0 ; i