How do I make a table already come sorted by a particular column in the DataTable?
How do I make a table already come sorted by a particular column in the DataTable?
You can do this here:
$(document).ready(function() {
$('#example').DataTable( {
order: [[ 3, 'desc' ]]
} );
} );
where order: [[ 3, 'desc' ]]
3 means your column number and desc means that it will sort from largest to largest or from Z to A, columns are numbered from 0 to the last, from left to right