DataTables - Default ordering

1

How do I make a table already come sorted by a particular column in the DataTable?

    
asked by anonymous 04.07.2017 / 16:53

1 answer

1

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

link

    
04.07.2017 / 17:21