【问题标题】:data table column misalignment in edge数据表列边缘未对齐
【发布时间】:2017-10-24 11:20:03
【问题描述】:

我正在使用数据表插件。但在边缘浏览器中,我得到列错位。

$(document).ready(function() {
    $('#example').DataTable( {
              destroy: true,
              paging: false,
              info: false,
              stateSave: true,
              bStateSave: true,
              dom: 't',
              'scrollX': true,
    } );
} );

这是 plunk 链接-https://plnkr.co/edit/rNHLC6gqSJDgdhkvNCa6?p=preview

我正在使用“scrollX”来获得响应。如果我删除滚动 X,列对齐似乎很好。任何线索都会有所帮助。

【问题讨论】:

    标签: jquery html css microsoft-edge datatables-1.10


    【解决方案1】:

    在你的 CSS 中将 tdth 设置为 white-space: nowrap 似乎可以解决这个问题。

      table.dataTable tbody th,
      table.dataTable tbody td {
          white-space: nowrap;
      }
    

    Here is a fork of your plunker with the proposed change

    【讨论】:

    • 您的修复工作有效,但在我的情况下它不可用 - 我必须在我的一些列中进行换行,以使内容适合合理的空间。在第一列换行之后,列开始偏离对齐。我发现这被报告为 Datatables GITHUB 上的一个问题,但那里没有解决方案:github.com/DataTables/DataTables/issues/893
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    • 2015-12-19
    • 2018-03-15
    • 1970-01-01
    相关资源
    最近更新 更多