How to show all rows by default in JQuery DataTable

Radislav picture Radislav · Feb 25, 2012 · Viewed 146.8k times · Source

Does anybody know how to show all rows by default in jQuery datatable?

I have tried this code, but it only shows 10 rows by default.

   $("#adminProducts").dataTable({
        "aLengthMenu": [100]
    });

Answer

LCoelho picture LCoelho · Oct 4, 2012

Use:

$('#example').dataTable({
    aLengthMenu: [
        [25, 50, 100, 200, -1],
        [25, 50, 100, 200, "All"]
    ],
    iDisplayLength: -1
});

Or if using 1.10+

$('#example').dataTable({
    paging: false
});