{hero}

lengthMenu

Since: DataTables 1.10

Change the options in the page length select list.

Description

This option sets the menu values for all pageLength table feature controls used for a table. The values it can take are defined in pageLength.menu, which be used to override this option (as of DataTables 2).

    ### Legacy

    DataTables 1.x used a 2D array rather than objects to support languages. The first inner array is the page length values and the second inner array is the displayed options. This is still supported in DataTables 2, although now deprecated.

Type

This option can be given in the following type(s):

Default

[ 10, 25, 50, 100 ]

Examples

Show options 10, 25, 50, 75 and 100 records:

new DataTable('#myTable', {
	lengthMenu: [10, 25, 50, 75, 100]
});

Show options 10, 25, 50 and all records:

new DataTable('#myTable', {
	lengthMenu: [10, 25, 50, { label: 'All', value: -1 }]
});

Related

The following options are directly related and may also be useful in your application development.