//when using thymeleaf $(document).ready(function() { $('#example').DataTable( { "order": [ [0, "desc"] ] } ); } );