I have a pre-generated html for the pagination numbers , which basically comes from the backend CMS based on the number of items present the html looks something like this
<p class="pagination-numbers">
<a class="" href="/content/go2bank/en/blogs/blog-list-page-1.html"> 1 </a>
<a href="/content/go2bank/en/blogs/blog-list-page-1.2.html"> 2 </a>
<a href="/content/go2bank/en/blogs/blog-list-page-1.3.html"> 3 </a>
<a href="/content/go2bank/en/blogs/blog-list-page-1.4.html"> 4 </a>
<a href="/content/go2bank/en/blogs/blog-list-page-1.5.html"> 5 </a>
<a href="/content/go2bank/en/blogs/blog-list-page-1.6.html" class="active"> 6 </a>
<a href="/content/go2bank/en/blogs/blog-list-page-1.7.html"> 7 </a>
</p>
the number of pages may increase based on the number of items, so currently the numbers are displaying all (eg: 1 2 3 4 5 6 7)
I want this to not display all the numbers but display a few i.e a first few and replace the rest with '...' and the last one should be displayed.
i want the pagination to look and behave like this something like this
Selected page 1: [1, 2, 3, 4, "...", 20]
selected page 2: [1, 2, 3, 4, "...", 20]
selected page 3: [1, 2, 3, 4, "...", 20]
selected page 4: [1, "...", 3, 4, 5, "...", 20]
selected page 5: [1, "...", 4, 5, 6, "...", 20]
.
.
.
.
.
selected page 18:[1, "...", 17, 18 ,19 , 20]
selected page 19:[1, "...", 17, 18 ,19 , 20]
selected page 20:[1, "...", 17, 18 ,19 , 20]
thanks in advance