douhuan4699 2015-11-18 00:36 采纳率: 100%
浏览 50

如何编辑数据表按钮的位置?

I got one problem, the page button of my datatables out of line. I used SB admin templates (bootstrap). I tried to edit my datatables function, but it's not working. I tried to JSFiddle in this function but its not work to.

My datatables's button

I want my datatables like this :

I want like this

I tried to edit my function, and this is my datatables's function :

<script>
    $('#datatables').dataTable
        ({  
            "sScrollX": "200%", //This is what made my columns increase in size.
            "bScrollCollapse": true,
            "sScrollY": "800px",

            "bAutoWidth": false,
            "aoColumns": [
                { "sWidth": "5%" }, // 1st column width 
                { "sWidth": "null" }, // 2nd column width 
                { "sWidth": "70%" }, // 3rd column width
                { "sWidth": "null" }, // 4th column width 
                { "sWidth": "null" }, // 5th column width 
                { "sWidth": "40%" }, // 6th column width
                { "sWidth": "null" }, // 7th column width 
                { "sWidth": "null" }, // 8th column width 
                { "sWidth": "null" }, // 9th column width
                { "sWidth": "35%" }, // 10th column width
                { "sWidth": "35%" }, // 11th column width
                { "sWidth": "null" }, //12
                { "sWidth": "null" }, //13
                { "sWidth": "null" }, //14
                { "sWidth": "null" }, //15
                { "sWidth": "null" }, //16
                { "sWidth": "15%" } //17
                ],

            "bPaginate": true,            
            "sDom":'<"H"lCfr>t<"F"ip>',
            //"sDom": '<"search"f><"top"l>rt<"bottom"ip><"clear">',
            "sPaginationType":"full_numbers",
            "aaSorting":[[0, "asc"]],
            "bJQueryUI":true    

        });
</script>

I tried to edit my sDom but it's not work to. I used codeigniter framework for this project. Please help. Thanks.

  • 写回答

1条回答 默认 最新

  • dongwuge6201 2015-11-18 05:05
    关注

    You can change data tables "sDom" options to use bootstrap class so that it fits the page width. You can try also by changing grid class combination like col-md-3,col-md-3 and col-md-6 or any other :

    {
        "sDom": '<<"col-md-4"f><"col-md-4"l><"col-md-4"i>><trp>'
    }
    OR
    {
        "sDom": '<<"col-md-3"f><"col-md-3"l><"col-md-6"i>><trp>'
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序