mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Fix: Row alignment with x-scrolling disabled and the table too small to draw fully. Previously DataTables would emit an error about the columns not aligning in this case, and then try its best to draw the table, but this would end up looking quite bad. The fix is to not allow the table to draw smaller than it can possibly be when x-scrolling is disabled. This effects dynamically resizable tables - 5232
This commit is contained in:
parent
0d94f1af0c
commit
3a63638916
13
media/js/jquery.dataTables.js
vendored
13
media/js/jquery.dataTables.js
vendored
@ -3966,6 +3966,12 @@
|
||||
* Get the unique column headers in the newly created (cloned) header. We want to apply the
|
||||
* calclated sizes to this header
|
||||
*/
|
||||
if ( o.oScroll.sX === "" )
|
||||
{
|
||||
nScrollBody.style.width = '100%';
|
||||
nScrollHeadInner.parentNode.style.width = '100%';
|
||||
}
|
||||
|
||||
var nThs = _fnGetUniqueThs( o, nTheadSize );
|
||||
for ( i=0, iLen=nThs.length ; i<iLen ; i++ )
|
||||
{
|
||||
@ -4026,6 +4032,13 @@
|
||||
*/
|
||||
iSanityWidth = $(o.nTable).outerWidth();
|
||||
|
||||
/* If x-scrolling is disabled, then the viewport cannot be less than the sanity width */
|
||||
if ( o.oScroll.sX === "" )
|
||||
{
|
||||
nScrollBody.style.width = _fnStringToCss( iSanityWidth+o.oScroll.iBarWidth );
|
||||
nScrollHeadInner.parentNode.style.width = _fnStringToCss( iSanityWidth+o.oScroll.iBarWidth );
|
||||
}
|
||||
|
||||
/* We want the hidden header to have zero height, so remove padding and borders. Then
|
||||
* set the width based on the real headers
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user