Both is fine.
I was unaware of your page structure, so I chose to prepend to the body, as that had to be there.
Not to sure how the pagination functionality works.
This way, at least it is called after that AJAX response has returned.
Maybe this is not necessary.
Why don’t you play around with it and see what works.
Hi pullo, is it possible that every page we will show 5 rows in the table,example if i will click next it will display the 5 sets or 5 row in my table.?
max_page is a variable, indicating how many pages (or sets) there will be to paginate through.
As you want to display 5 records (table rows) on each page we have to get the total amount of rows and divide it by five.
In the case that the result is not a whole number, we round it up to the next integer using Math.ceil.
e.g. 15 rows
15/5 = 3
e.g. 16 rows
16/5 = 3.2.
Math.ceil(3.2) = 4
The plus one accounts for the table header (which is also a table row).
Hi pullo, I get back to you because i have problem on loading my page with pagination,…when i tried to put my page on the host,my page is very slow in displaying the pagination.Does this affect in the code that we use?