pagination logic in calculating total of pages
Divide total_items
by limit
, and round the value up.
Math.ceil(total_items/limit);
50 items / 10 per page = 5 pages
55 items / 10 per page = 6 pages
Divide total_items
by limit
, and round the value up.
Math.ceil(total_items/limit);
50 items / 10 per page = 5 pages
55 items / 10 per page = 6 pages