jQuery Datatables Header Misaligned With Vertical Scrolling

前端 未结 20 2619
北海茫月
北海茫月 2020-12-15 05:05

I\'ve posted this in the datatables.net forums, but after a week, still no response. Hopefully I can find help here...

I\'m using datatables version 1.8.1 and am ha

20条回答
  •  没有蜡笔的小新
    2020-12-15 05:12

    I solved this problem by wrapping the "dataTable" Table with a div with overflow:auto

    .dataTables_scroll
    {
        overflow:auto;
    }
    

    and add this JS after your dataTable initialization

    jQuery('.dataTable').wrap('
    ');

    Dont use sScrollX or sScrollY, remove then and add a div wrapper yourself which does the same thing.

提交回复
热议问题