dataTable 怎么控制tr宽度,如何设置

0 0 javascript html5 css
︷.゛打酱油
︷.゛打酱油

声望值:103 0人

2018-08-08 15:20:33 提问

关注 0关注

收藏 0收藏, 1838浏览

g_simpool_vom_table = $('龙8国际娱乐pt老虎机' + simpool_vom_table_id).DataTable({
        "language": {
            "lengthMenu": "每页 _MENU_",
            "zeroRecords": "没有找到记录",
            "info": "第 _PAGE_ 页 (总共 _PAGES_ 页 )",
            "infoEmpty": "无记录",
            "infoFiltered": "(从 _MAX_ 条记录过滤)",
            "sSearch": "搜索",
            "oPaginate": {
                "sFirst": "第一页",
                "sPrevious": " 上一页 ",
                "sNext": " 下一页 ",
                "sLast": " 最后一页 "
            }
        },
        "destroy": true,
        "paging": true,
        "pagingType": "simple_numbers", // simple, numbers, simple_numbers, full, full_numbers, first_last_numbers
        "lengthMenu": [5, 10, 20, 50, 100],
        "pageLength": 10,
        "lengthChange": true,
        "searching": true,
        "ordering": true,
        "info": true,
        "select": 'single',
        "autoWidth": true,
        "deferRender": true, // 延迟渲染,加速界面加载.
        "fixedHeader": true,
        "scrollX": false,
        "scrollY": false,
        "scrollCollapse": true,
        "stripeClasses": ['odd', 'even'],
        "dom": '<"row"<"col-lg-1"<"toolbar">><"col-lg-4"B><"col-lg-7"f>>t<"row"<"col-lg-2"l><"col-lg-3"i><"col-lg-7"p>>',
        //          "dom": '<"row"<"col-lg-4"B><"col-lg-8"f>>t<"row"<"col-lg-2"l><"col-lg-3"i><"col-lg-7"p>>', 
        "buttons": {
            // 'copy', 'csv', 'excel', 'pdf', 'print'
            "buttons": [{
                    extend: 'copy',
                    text: '',
                    className: 'btn btn-warning btn-flat'
                },
                {
                    extend: 'csv',
                    text: '',
                    className: 'btn btn-warning btn-flat',
                    title: 'Mote Lists-' + new Date()
                },
                {
                    extend: 'print',
                    text: '',
                    className: 'btn btn-warning btn-flat',
                    title: 'Mote Lists-' + new Date()
                }
            ]
        },
        "aoColumns": columnDefines,
        "ajax": {
            url: ajaxUrl,
            data: ajaxPara,
            dataType: 'json',
            type: "POST",
            dataSrc: '' //""=[],即普通Arr,  datarow:{"datarow": []} 
        }
    });
    //toolbar
    $("龙8国际娱乐pt老虎机simpool_vom_table_pdiv div.toolbar").html(getSimPoolVomTabToolBar());
    //创建
    $("龙8国际娱乐pt老虎机btn_flow_add").unbind("click");
    $("龙8国际娱乐pt老虎机btn_flow_add").on("click", function() {
        btn_flow_add_click();
    });

情况如图
图片描述

请先 登录 后评论

1个回答

  • 帅气丶月半104声望 2018-08-08 11:44

    tr宽度?td的宽度吧?两个配置项: $('龙8国际娱乐pt老虎机example').dataTable( { "autoWidth": false, "columns": [ { "width": "20%" }, null, null, null, null, null ] } ); 参考API:autowidth、columns.width
    请先 登录 后评论

龙8国际娱乐pt老虎机

悬赏追问
10
  • 10
  • 20
  • 50
  • 100
  • 200
  • 输入数值
发布追问