int maxToDisplay = 10;
int page = Math.max(1, currPage - (maxToDisplay / 2));
int idx = (page - 1) * pager.getPageSize();
for (int pageIdx = 0; pageIdx < maxToDisplay && idx < pager.getFilteredRowCount(); pageIdx++) {
boolean selected = idx >= pager.getStartRow() && idx < pager.getStartRow() + pager.calcPageSize();
results.append("<li><a href=\"");
results.append(selected ? "#" : getPageLink(idx, pager));
results.append("\" ");
results.append(makeStyles(false, selected));
results.append("><div class=\"pageNumber\">");