views:

82

answers:

3

I am making a table of data that needs to printed out. I want the header to be at the top of each page. SO I am thinking the best way to do this is to repeat the header maybe every 30 columns or so, and break it into sections. But theres still no way to ensure that each section gets printed on its own page that I know of. Does anyone know how to do what I am trying to do? Main concern is just making the header at the top of each page when printing out the table of data.

Thanks!

+4  A: 

Make sure your table headers are in the section of the table, then use CSS to style it:

thead { display: table-header-group; }
Kev
A: 

sigh This one brings back memories. Over the years I have wrestled with browser printing. I finally threw in the towel, and now just send the user a PDF.

I (and my customers) are much happier with the results.

Lance Rushing
Things aren't as bad with CSS3 nowadays, at least on some browsers...(maybe that was key for you.)
Kev
A: 

You may want to check out this article regarding paged media and css. It's a pretty good read and should get you going in the right direction.

Printing a Book with CSS: Boom!

An example using the page break css rules for a table.

@media print
{
   table {page-break-after:always}
}

Here's also the w3c references to paged media.

CSS2 CSS3

r-dub