jQuery DataTables sDom命令不工作 [英] jQuery DataTables sDom order not work

查看:178
本文介绍了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天全站免登陆