Duplicate empty header occur in datatable when enabling scrollX or scrollY when using Google Chrome

后端 未结 10 1101
猫巷女王i
猫巷女王i 2021-02-06 00:09

I have a datatable in my program. And I want it to be scrollable horizontally so what I did was like this:

var tableI = $(\'#table_data\').DataTable({
    \"bLe         


        
10条回答
  •  旧时难觅i
    2021-02-06 00:24

    Solution 1 :

    To Resolve This Please Use "scrollXInner": true Avoid to Using "scrollX": true"

    var tableI = $('#table_data').DataTable({
        "bLengthChange": false,
        "scrollX": true, //Do Not Use This (Remove This Line)
        "scrollXInner": true //Use This (Add This Line)
         "dom": 'frtp'
    });
    

    Solution 2 :

    OR You Can Add This CSS

    .dataTables_scrollBody thead tr[role="row"]{
        visibility: collapse !important;
    }
    

提交回复
热议问题