2016-06-30 18 views
1
$(document).ready(function() { 
    var myTable = $('#example').DataTable({ 
     "serverSide": true, 
     "processing": true, 
     "paging": true, 
     "autoWidth": false, 
     //"searching": { "regex": true }, 
     searching: false, 
     "lengthMenu": [ [10, 25, 50, 100, 250,500 ,1000], [10, 25, 50, 100, 250,500 ,1000] ], 
     "ajax": { 
      "type": "POST", 
      "url": "packetsScannedListData?total=" +total , 
      "dataType": "json", 
      "contentType": 'application/json; charset=utf-8', 
      "data": function (data) { 
       var info = $('#example').DataTable().page.info(); 
       pageOrders = {}; 
       return JSON.stringify(info); 
      } 

    }, 
     "columns": [ 
       { "data": "orderNo" }, 
       { "data": "crderDate" }, 
       { "data": "clientName" } 
      ], 

    }); 

Antwort

1

zu erhöhen, können Sie hinzufügen:

"columnDefs": [ 
    { "width": "percent%", "targets": numOfDesiredColumn } 
] 
1

Wie diese Stellen die Breite der ersten Spalte bis zu 20% mit

$('#example').dataTable({ 
     "columns": [ 
     { "width": "20%" }, 
     null, 
     null, 
     null, 
     null 
     ] 
    }); 
0

Sie können es tun, indem

$('#example').dataTable({ 
    "columns": [ 
    { "width": "20%" }, 
    null, 
    null, 
    null, 
    null 
    ] 
}); 

dieser Wille Setup erste Spaltenbreite 20%