DataTables fixed headers misaligned with columns in wide tables

前端 未结 21 1584
悲&欢浪女
悲&欢浪女 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:17

    I am having the same issue on IE9.

    I will just use a RegExp to strip all the white spaces before writing the HTML to the page.

    var Tables=$('##table_ID').html();
    var expr = new RegExp('>[ \t\r\n\v\f]*<', 'g');
    Tables= Tables.replace(expr, '><');
    $('##table_ID').html(Tables);
    oTable = $('##table_ID').dataTable( {
      "bPaginate": false,
      "bLengthChange": false,
      "bFilter": false,
      "bSort": true,
      "bInfo": true,
      "bAutoWidth": false,
      "sScrollY": ($(window).height() - 320),
      "sScrollX": "100%",
      "iDisplayLength":-1,
      "sDom": 'rt<"bottom"i flp>'
    } );
    

提交回复
热议问题