Forum Moderators: not2easy

Message Too Old, No Replies

CSS printing control

stop splitting tables across pages?

         

nbozic

8:47 pm on Jan 4, 2005 (gmt 0)

10+ Year Member



Hi,

I was wondering if there is a trick with CSS (or something else), that will let me have more control over the stuff I print. For example, I'm curently making a report generator page with 5 html tables on it. When I print the page, the tables are split across different pages. Is there a way to print one table per page or something like that? Basically I don't want a table to start on the bottom of one page, and then continue on another one.

Any help would be appreciated.

Thanks,

NB

encyclo

6:28 pm on Jan 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try adding a page break after each table:

table
{
page-break-after:always;
}

If necessary, you can add a class to the tables which need the page break and define the style on just that class name.

piskie

6:55 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



I have used just that method for 2 or 3 years now and only obsolete Browsers/OS combinations play up.
You can also use
{
page-break-before:always;
}

Inline styles can be applied within many HTML elements such as:
Style="page-break-after: always"
OR
Style="page-break-before: always"

nbozic

7:02 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



Very nice! Thank you both :)