Is there a way to expand column width?

Is there a way to expand column width?

jer040506jer040506 Posts: 5Questions: 3Answers: 0
<table id="listoftable" class="table table-bordered" >
     <thead class="thead-dark">
    <tr>
        <th>File Name</th>
        <th>PDF</th>
        <th>Excel</th>
        <th>Archive</th>
    </tr>
        </thead>
</table>

  $(function() {
 var table = $('#listoftable').DataTable({
       processing: false,
      serverSide: true,
      "aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
      "iDisplayLength": 5, 
      ajax: '{!! route('admin.get.listtable') !!}',
     columns: [
       { data: 'tables_in_db', name: 'tables_in_db' },
       {data: 'pdf', name: 'pdf', "searchable": false, "orderable": false },
       {data: 'excel', name: 'pdf', "searchable": false, "orderable": false },
       {data: 'delete', name: 'delete', "searchable": false, "orderable": false },

       ]
     });
 });

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
  • jer040506jer040506 Posts: 5Questions: 3Answers: 0

    This doesn't do anything

     $(function() {
      var table = $('#listoftable').DataTable({
        processing: false,
        serverSide: true,
         "columns": [
       { "width": "50%" },
       { "width": "10%" },
       { "width": "20%" },
       { "width": "20%" },
       ],
        "aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
        "iDisplayLength": 5, 
        ajax: '{!! route('admin.get.listtable') !!}',
        columns: [
          { data: 'tables_in_db', name: 'tables_in_db' },
          {data: 'pdf', name: 'pdf', "searchable": false, "orderable": false },
          {data: 'excel', name: 'pdf', "searchable": false, "orderable": false },
          {data: 'delete', name: 'delete', "searchable": false, "orderable": false },
    
           ]
          });
    
  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    You've got two columns objects - put the widths in the second one.

  • jer040506jer040506 Posts: 5Questions: 3Answers: 0

    this only do small amount of width can i expand it at my will?

     { data: 'tables_in_db', name: 'tables_in_db' , 
    "width": "150%" },
    
This discussion has been closed.