detj detj - 1 year ago 62
Javascript Question

How to change results per page value in datatables

Datatables has an option to select the number of records shown per page. The default value starts from 10, 25, 50 and 100. How can I change it to start from 5 instead of 10?
10 records is a bit too much and takes a lot of space in my current design.

Answer Source

You will want to use the iDisplayLength parameter when you initialize the DataTable object. Here's the example they list in their documentation:

$(document).ready( function() {
    $('#example').dataTable( {
        "iDisplayLength": 50
    } );
} )

More information can be found here: