VOOZH about

URL: https://www.geeksforgeeks.org/jquery/datatables-pagelength-option/

⇱ DataTables pageLength Option - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

DataTables pageLength Option

Last Updated : 13 Jul, 2021

DataTables is jQuery plugin that can be used for adding interactive and advanced controls to HTML tables for the webpage. This also allows the data in the table to be searched, sorted, and filtered according to the needs of the user. The DataTable also exposes a powerful API that can be further used to modify how the data is displayed.

The pageLength option is used to specify the number of rows of the table that are to be displayed on one page. This option is relevant when the pagination is used to display many rows. It accepts an integer value that denotes the number of rows to be displayed.

Syntax:

{ pageLength: value }

Parameters: This option has a single value as mentioned above and described below.

  • value: This is an integer value that specifies the number of rows to be displayed. The default value is 10.
 

The examples below illustrate the usage of this option.

Example 1: This example demonstrates setting the number of rows per page to be 3.

Output:

👁 Image

Example 2: This example demonstrates setting the number of rows per page to be 6. 

Output:

👁 Image
pagelength is 6 

Reference link: https://datatables.net/reference/option/pageLength

Comment
Article Tags:

Explore