ja**************@hotmail.com (James) wrote:
I need to define paragraphs on my site that should not break across a
page when printed, similar to widow/orphan control in Word. Is this
possible to implement? We only use IE6 so no cross-platform is
required.
Bad news first: there is no nice way.
In theory, CSS 2 gives us the properties widows and orphans. For example,
p { widows: 3; orphans: 3; }
says that a browser should not separate one or two lines from the rest of
paragraph into a separate page. But as far as I know, only Opera supports
this.
And CSS also lets you say
p { page-break-inside: avoid; }
to simply suggest that no paragraph be split across pages. But IE doesn't
support this either.
What works is "positive" page-break settings like
p.newpage { page-break-before: always; }
but this gets awkward, since you would need to decide and guess where
page breaks should appear and write markup like
<p class="newpage">...</p>
and the page breaks could appear at odd places, when font size, paper
size, etc., differ essentially from the expectations.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/