DataTables fixed headers misaligned with columns in wide tables

前端 未结 21 1613
悲&欢浪女
悲&欢浪女 2020-11-30 19:23

Problem

When using the sScrollX, sScrollXInner and/or sScrollY to achieve a fixed header table with its inner content scroll

21条回答
  •  我在风中等你
    2020-11-30 20:18

    I use this for Automatic column hiding as per column data, in that case, sometimes its break table structure. i solve that problem with this $($.fn.dataTable.tables(true)).DataTable().columns.adjust(); and this function $('#datatableId').on('draw.dt', function () { }); call after tabledata load.

    $('#datatableId').on('draw.dt', function () {
        $($.fn.dataTable.tables(true)).DataTable().columns.adjust();
    })
    

提交回复
热议问题