Default # of Results for Tables


Topic: Default # of Results for Tables

Marco Moutinho asked 6 years ago

Is it possible to set a default # of results for datatables?

It defaults to 10, I have searched in the Tables section but can't seem to find an option.


Bartłomiej Malanowski staff pro premium answered 6 years ago

It's easy - just use the pageLength option (which has a default value set to 10 as you noticed). Example:

$('#example').dataTable({
  "pageLength": 15
});

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: Other
  • MDB Version: -
  • Device: Desktop
  • Browser: Chrome
  • OS: Mac OSX
  • Provided sample code: No
  • Provided link: No