mercredi 15 juin 2016

DataTables "sticky" table headers for a Drupal view


How to display the table's header and / or footer fixed to the top or bottom of the scrolling window? I used datatables module with Drupal 7, but the module does not offers an option to make table's header sticky. This page was also helpful (https://datatables.net/extensions/fixedheader/) but I could not get the code to work on my custom js file.

var table = $('#datatable-1').DataTable();

new $.fn.dataTable.FixedHeader( table, {
    bottom: true
} );

Aucun commentaire:

Enregistrer un commentaire