page 1, page 2, and so on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 56
How can I fix this?
similar to google pagination
page 1, page 2, and so on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 56
How can I fix this?
similar to google pagination
You could use a paging plugin, such as pagination.js .
A small example of usage, taken from documentation , would look like this:
$('#demo').pagination({
dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195],
callback: function(data, pagination) {
// template method of yourself
var html = template(data);
dataContainer.html(html);
}
})
As @Juven_v said above you can opt for a Javascript library to page. But as your tag is in PHP the solution would be to implement a pagination using the LIMIT of the database. And another logic to control the total pagination depending on the user's current page.
Example: Initially it could show 1, 2, 3, 4 ............ 49, 48, 50 and then change according to the current page.