Is there a way to limit the page numbers in Datatables pagination?
Is there a way to limit the page numbers in Datatables pagination?
PrateekParekh
Posts: 13Questions: 3Answers: 0
Datatable with sPaginationType as full_numbers shows the last page number as well:
On page 1: 1 2 3 4 5 11
On page 2: 2 3 4 5 6 11
....And so on........
On Page 11: 1 8 9 10 11
I want it to be like:
On page 1: 1 2 3 4 5
On page 2: 2 3 4 5 6
....And so on........
On Page 11:7 8 9 10 11
Is there a way to achieve this?
This discussion has been closed.
Replies
You want to limit the page numbers, but show all the page numbers?... In your first example, they were at all sequential, in your 2nd, they were, but you paused between the 6 and 7... So im just a little confused.
Regardless though, there isn't a way to accomplish this (that I know if), short of creating your own plugin to do it
Hi,I have tried to clarify the question.
I don't believe so, not without creating a custom plugin or something...
If you're a jQuery friendly person, you can look into the DT Source code to look at how the paging buttons are created, and basically take that and alter it into your own function or plugin.. which I would recommend.
Maybe @allan has a better idea
@allan Any simpler way using jQuery than creating a plugin?
I believe your issue is similar to the issue in this thread, which the answer from allan is basically what I stated above