Answers for "datatable hide ascending order"

0

jquery datatable disable sorting on specific columns

jquery datatable disable sorting on specific columns

"columnDefs": [
    { "orderable": false, "targets": 2 }
  ]

JSFiddle Here

<!--Script.js-->
$('#table').DataTable( {
"columnDefs": [
    { "orderable": false, "targets": 2 }
  ]
  });
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet"/>

<table class="table table-striped table-bordered post-list-table" id="table" >
  <thead>                      
    <tr>
      <th>Title</th>
      <th>Created At</th>
      <th>Action</th>
    </tr>
  </thead>
</table>
Posted by: Guest on August-03-2021
-1

orderable false in datatable

$('#example').DataTable( {
  columnDefs: [
    { orderable: false, targets: 0 }
  ]
} );

reference: 
https://datatables.net/reference/option/columns.orderable
Posted by: Guest on January-29-2021

Browse Popular Code Answers by Language