I want to divide my array into pages, 4 per page. I have found out how many pages I will need:
var no_of_entries = docs.length;
var no_of_pages = (Math.round(no_of_entries / 4));
How would I add ‘s with page numbers in and a unique id from this variable?
i.e if the variable for no_of_pages is 3, I’ll need 3 spans, numbered 1-3 each with unique id’s (preferabbly the id matching the number).
you might try something like this:
Here is a jsfiddle: http://jsfiddle.net/NqdBW/