Disable sorting for one specific Datatables.net column via class and columnDefs


JavaScript

Add "no-sort" class to your column header

<th class="no-sort">COLUMN TITLE</th>

Add the following columnDefs code to your initialize of the Datatable.

columnDefs: [
      	{ targets: 'no-sort', orderable: false},
],

Written by fbrefere001

Posted by fbrefere001 on Thursday March 6, 2025