jQuery DataTables sDom 顺序不起作用 [英] jQuery DataTables sDom order not work

查看:17
本文介绍了jQuery DataTables sDom 顺序不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要左上角的过滤器"和右上角的大小",但不起作用:

I need the "filter" in the upper left side and the "size" in the upper right side, but is not working:

$(document).ready(function() {
    jQuery('#example').dataTable({
            "sDom": '<"top"fl>rt<"bottom"ip><"clear">'
        });
} );

为什么?

推荐答案

解决方案

  • 使用这两个 CSS 规则来定位所有数据表:

    • Use these two CSS rules to target all data tables:

      .dataTables_wrapper .dataTables_filter {
        float: left;
      }
      
      .dataTables_wrapper .dataTables_length {
        float: right;
      }
      

    • 使用这两个 CSS 规则来定位#example 数据表:

      #example_wrapper .dataTables_filter {
        float: left;
      }
      
      #example_wrapper .dataTables_length {
        float: right;
      }
      

    • 演示

      有关代码和演示,请参阅此 jsFiddle.

      See this jsFiddle for code and demonstration.

      这篇关于jQuery DataTables sDom 顺序不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆