Printing: widow/orphan control

Printing: widow/orphan control

Post by jameshamil » Wed, 04 Aug 2004 19:56:57


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.

Thanks
James
 
 
 

Printing: widow/orphan control

Post by Jukka K. K » Thu, 05 Aug 2004 01:28:06


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.yqcomputer.com/ ~jkorpela/

 
 
 

Printing: widow/orphan control

Post by Stephen Po » Thu, 05 Aug 2004 04:04:13

On 3 Aug 2004 03:56:57 -0700, XXXX@XXXXX.COM (James)



Yes.


Oh dear. In that case you'll have to upgrade to a decent browser first.
(Actually I believe Opera is the only one to support page-break-inside
at present.)

--
Stephen Poley

http://www.yqcomputer.com/ ~sbpoley/webmatters/
 
 
 

Printing: widow/orphan control

Post by Seymour » Thu, 05 Aug 2004 05:41:54

In < XXXX@XXXXX.COM >, on 08/03/2004
at 03:56 AM, XXXX@XXXXX.COM (James) said:


Define styles with appropriate values for orphans, page-break-inside
and widows, e.g.,

div.res dl dt {
font-weight: bold;
line-height: 3;
orphans: 4;
text-decoration: underline;
widows: 3; }
div.res dl dd { font-size: medium; }
div.res p {
orphans: 4;
page-break-inside: avoid;
widows: 3; }

--
Shmuel (Seymour J.) Metz, SysProg and JOAT < http://www.yqcomputer.com/ ~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to XXXX@XXXXX.COM