Page breaks

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm programming in Delphi and use HTML for reporting and printing.  Problem
is this.  The HTML documents contain a varying number of tables, of
different sizes.  The documents also may contain text that wraps around at
the end of line.  When I try to print the HTML, the tables often end up
being broken over two pages.  What can I do, to force Internet Explorer, to
print a table on the next page if it will not fit on the current page, when
it is being sent to the printer?

Any help wil be appreciated

Re: Page breaks

MW de Jager wrote:
Quoted text here. Click to load it

I'm affraid that is impossible. Maybe it's an improvement to add a page
break before the table:
table {page-break-before: always}


Re: Page breaks

On Tue, 5 Apr 2005 08:45:16 +0200, "MW de Jager"

Quoted text here. Click to load it

You have two avenues of approach, CSS and the page-break rules (sadly
poorly supported)  and also you're generating the content from a
useful programming language. You can do some reasonable estimation of
page location for each row and then apply classes to relevant lines of
the output HTML to invoke CSS that strongly hints "page-break-after :
always" or "page-break-before : avoid"

You can also use a CSS media rule to set the font-size for printing in
points, rather than ems (as you'll be using on screen)

There will now be a flurry of posters to point out that you can't do
this in HTML, They're right of course, but this isn't HTML - it's HTML
intended for print. You know the page size (ignoring margins and US
letter paper) and you have a good probablility of knowing the text
size in points. Within this constraint of print targetting, then you
can certainly improve mattes.

Smert' spamionam

Re: Page breaks

Gazing into my crystal ball I observed Andy Dingley

Quoted text here. Click to load it

I would add to that, if you are using different margins or if you have
navigation, copyright, header information that you do not want printed,
this is what I do:

@media screen {
@media print {
#nav, #footer, #copyright

Adrienne Boswell
Please respond to the group so others can share

Re: Page breaks


Quoted text here. Click to load it

I do a lot of that too, but I tend to do it by putting "print-only"
and "no-print" classes onto the HTML.  I do it for a major page
component like "nav-menu" of "advertising-banner" and such, but I
wouldn't do it for something smaller like "copyright". I might
sometimes want to print that, so I'd rather keep the specificity in
the HTML, rather than the CSS.

I'm also not that keen on using ids rather than classes for top-level
structure like "footer".  An id has a high value in a CSS selector
compared to a class, and this makes it difficult to sub-class CSS
behaviour by applying another class to elements within it.

Richard Nixon. A great man who gave the world many things; detente with
China, withdrawal from Vietnam, and an inexhaustible supply of cheap
newspaper headlines, all ending in "Gate"

Site Timeline