Use pagination js to quickly paginate non-table content

Connect Asia Data learn, and optimize business database management.
Post Reply
aminaas1575
Posts: 32
Joined: Sun Dec 22, 2024 4:03 am

Use pagination js to quickly paginate non-table content

Post by aminaas1575 »

When you are developing a program, you will encounter that when the amount of data is huge, it will be impossible to display all the data on the same page at once due to various restrictions, so when we encounter this situation, we usually need to use " The concept of "paging" is used to facilitate users to browse huge amounts of data. In terms of displaying data, in the past, most of the data we presented were in the form of tables. Therefore, many companies have developed their own methods for fast table paging. On the Internet There are also many js packages that can meet this requirement, such as datatable.

But there is a situation where when we are presenting non-typical determinant data (such as pictures, articles, etc.), it is not impossible to use table to present it, but there will be many problems in australia whatsapp phone number adjusting the style and how to present it. Points to consider.


Example image: Presentation of image pagination

Example diagram of pagination

Although this requirement is uncommon, it is a big problem when encountered, especially for engineers who have relatively weak concepts of front-end styles such as CSS.



Suggested solution

In fact, if you do a little research on the Internet, there are many packages that do pagination, but in terms of atypical presentation of pagination, the one I currently use most conveniently is pagination.js .



First introduce the js and css of pagination
js cdn path:


It is important to note that jQuery must be referenced before introducing pagination to ensure normal operation.

We assume that the data we get through ajax is similar to the following json data:
Post Reply