I am sorry your previous explanations led make those suggestions.
Now I see what you meant.
I have developed such web applications countless times.
The bulk of your app is on the server-side.
1) Define the maximum number rows that will retrieved.(e.g. $limit=20; )
2) Determine how the total number results that query can return. ($maxrows)
That will allow you to create pagination links.
The number of "pages" $np=$maxrows/$limit.
3) Each link in your pagination section will be related to a given value of a cursor;
Your pagination links will therefore look like:
<a href="/url?np=$np&cs=0">1</a> <a href="/url?np=$np&cs=1">2</a> ..
4) For a given value of $cs in your URL your SQL query can be like:
$sql="SELECT ..... ORDER BY .... LIMIT $skip, $limit";
Of course the variable $np, $cs, $limit, $skip assume your server-side programming is PHP. It's up to you to write the script in your favorite server-side language.