开发者

How to create pagination with JQuery?

There is a html table which data are from a MySql database , got by using PHP. If there are many rows returned from the database then I want to show only 10 rows in the table and at the bottom of it there are numbers indicating 开发者_如何学Ca page-like indicator ( like when we google ). So how to achieve this pagination with JQuery ?


You don't want to do the pagination in jQuery, since pagination's objective is to prevent fetching data you don't need. There's plenty of answers in Google, but the way I've done it in the client side is using datatables.

As for the server side pagination, PHP would get the number of items to fetch and the index of the starting item as parameters, then you would query the database with something like:

SELECT * FROM tablename LIMIT startingIndex, itemsToFetch;


Maybe this would help

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜