example:
def show_records():
if len(request.args):
page=int(request.args[0])
else:
page=0
query=db.table.id>0 ### for example
rows=db(query).select(limitby=(page,page+100))
backward=A('backward',_href=URL(r=request,args=[page-100]) if page else ''
forward=A('forward',_href=URL(r=request,args=[page+100]) if len(rows) else ''
return dict(rows=rows,backward=backward,forward=forward)