Leave fixed paging using jQuery datatable

0

I have a table and I'm using datatable of jQuery , however, my table has a lot of column, and I made a scroll in it, but in that my pagination scrolls along with the scroll, would have some way to leave the pagination fixed

EXAMPLE HERE

Thank you.

    
asked by anonymous 24.03.2015 / 13:43

3 answers

1

To leave the page above the table, just use the sDOM option API to rule that the pagination will be up. This way:

$(document).ready(function(){
    $('#myTable').DataTable(
      {
        "sDom": '<"top"p>'
      }
    );
});

For the rest, you style the way you want.

    
09.11.2015 / 14:36
0

Hello, just add settings via CSS, as follows:

#myTable_paginate {
    float:left !important;
}

You can put other settings like padding and margin for example, to fit better

    
24.03.2015 / 14:06
0

To do this, simply define from the plugin itself, using the scoolX option, see:

$(document).ready(function(){
    $('#myTable').DataTable({
      'scrollX' : true
    });
});

For more information about the features that plugin makes available, just follow the references.

References:

Basic initialisation - DataTables

Scroll - Horizontal

    
09.10.2015 / 01:49