Below is the code that I found (thanks to The_Sumo) on this link and the code works like a charm. I am trying to add an additional column to the table that displays the ordered list number of the users like:
1 John Doe firstname.lastname@example.org
2 Jane Doe email@example.com
One method I tried that kinda worked - i.e. I created a counter before the condition statement (
$counter = 0).
Then right after the opening bracket of the foreach loop, I am incrementing the counter by 1 (
$counter = $counter + 1;) and printing the value of
$counter within the table.
The issue I am facing is - when I click next page, the counter value starts from 1 again instead of continuing from where it left of.
So lets say I want to display 5 items in each page, so page 1 should display 1 - 5 and on page 2 6-10 - instead page 2 shows 1-5 again. Just the numbers. Any idea how to fix that? Thanks.