How do I create HTML prints with headers and footers?
October 1, 2005 10:25 PM
Subscribe
How do I create HTML that emulates a word processor's "headers and footers" feature? I need to create some HTML (probably via a XSL transform) that has header and footer blocks that contain certain pieces of repeated dynamic information including total number of pages, current page, etc.
My wife is a elementary school teacher and has conned me into writing a good lesson plan editor for Mac OS X. The output of the editor should be a table that spans two or three pages. Each page should have a header with the date and title and a footer with the current page number and total number pages.
I think outputting HTML would be relatively easy - my program can output an intermediate XML file which I will then use XSL to transform into pretty HTML. The question is how do I format this HTML so that it mimics her current lesson plans (created by hand in MS Word) and has nicely formatted headers and footers?
The lesson plans only need to render inside Safari - so I do not care at all about compatibility with other browsers. I know I can use thead/tbody and CSS overflow to get a table to scroll but keep its header in place. But I cannot get it to print correctly, the elements inside thead only end up being printed on the first page. Also a thead element can only contain other table elements and not any piece of HTML - so I would have to do some horrible table layouts.
posted by schwa to computers & internet (9 comments total)
posted by furtive at 11:01 PM on October 1, 2005