简体   繁体   中英

Columns don't fit to header - datatables with Scroller plugin

I'm using Datatables with Scroller plugin and server-side loading. When data are loaded, header columns are resized and often (not always) don't fit to inside columns.

Picture of a situation ( http://i.stack.imgur.com/J3zMz.png ):

在此处输入图片说明

Relevant datatables setting code:

"sScrollY" : window.innerHeight - 270,
            "bServerSide" : true,
            "sDom" : "frtiS",
            "bProcessing" : true,
            "bDeferRender" : true,
            "bAutoWidth" : true,
            "oScroller" : {
                "rowHeight" : 33,
                "autoHeight" : false,
                "serverWait" : 100
            },

Is there any way how force header columns to always fit the content (and vice versa)? Thanks.

try

$(window).load( function () {
   $('#myTable').dataTable().fnAdjustColumnSizing( false );
} );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM