JD Isaacks
JD Isaacks

Reputation: 58014

HTML specify print pages?

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!

Upvotes: 5

Views: 287

Answers (3)

rwilliams
rwilliams

Reputation: 21497

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

Upvotes: 0

Lance Rushing
Lance Rushing

Reputation: 7640

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.

Upvotes: -1

Kev
Kev

Reputation: 16341

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

thead { display: table-header-group; }

Upvotes: 4

Related Questions