Topic: MDB table component pagination initial page size

joel2 free asked 4 years ago

I am using the Datatable component with Table pagination.

I would like to change the default page size to 25. I have tried :

    $(document).ready(function () {
            "ordering": false
        $('select[name ="dtBasicExample_length"]').val("25");

but while that sets the dropdown it does not change the page size.

Is there an option like?

    "ordering": false,
    "pagingSize" : 25

Mateusz Łubianka staff answered 4 years ago

Hi @joel2,

Try to use this code:

<!-- Your custom scripts (optional) -->
  <script type="text/javascript">
    $(document).ready(function () {
        "pageLength": 50

I used it and it works fine.


joel2 free commented 4 years ago

Just the ticket Mateusz, works perfectly. Many thanks.

Mateusz Łubianka staff commented 4 years ago

I'm glad I could help.


Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.11.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No