Change values of select box of "show 10 entries" of jquery datatable

rjmcb picture rjmcb · May 17, 2012 · Viewed 112k times · Source

By default, jquery datatable shows 10 by default and has

options : 10,25,50,100

How can I change these options?

Answer

davesave picture davesave · Apr 18, 2013

Don't forget to change the iDisplayLength as well:

$(document).ready(function() {
    $('#tbl_id').dataTable({
        "aLengthMenu": [[25, 50, 75, -1], [25, 50, 75, "All"]],
        "iDisplayLength": 25
    });
} );