Is there any way to get page numbers at the bottom of my HTML pages for print purposes?

I can put page numbers in with a WebWorks macro called $PAGENUMBER; but how is the bottom of the page determined? After printing, the page number might appear in the middle of the page.

Is there any way to determine page size, then get the page number at the bottom of the page?