PDA

View Full Version : Insert page breaks for Printing


Gary Williams
08-19-2003, 10:02 PM
Hi All,

I need to insert page breaks into an html email so that each section starts printing on a new page. I've been reading about CSS2, print css files and 'page-break-after' but I need a simple example to follow.

Anyone got one I may have?

Regards

Gary

MotherNatrsSon
08-19-2003, 10:27 PM
div{
page-break-after: always
}

Something like that. Just put it in the css for the element you want the page break after.

MNS

Gary Williams
08-20-2003, 08:51 AM
Hi MNS,
Sorry, I'm brain dead on this issue. Do you mean .....

<!-- CSS File -->

div frmquotation{
page-break-after: always
}


<!-- Part of html code -->

<TABLE>
<TR><TD>Quote Reference: </TD></TR>
</table>

<FORM NAME="frmquotation">

Regards

Gary

MotherNatrsSon
08-20-2003, 05:28 PM
Can you post a link or the code in whole? You have the right idea but you are not referencing your form, you are referencing a div. Is the form inside a div or a table? You do have the basic jist correct, I am just not sure hat it would actually put the page break in where you want it set like that.

MNS

Gary Williams
08-20-2003, 10:36 PM
Hi MNS,

Here is a stripped down version of the file to be printed:

=========================

<HEAD>

<STYLE>
/* CSS definition file*/
BODY { font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,sans-serif; font-size: 12px; color: rgb(102,102,102); font-weight: normal; font-style: normal; text-decoration: none ;}
</STYLE>

</HEAD>
<BODY>

<DIV align="center">

<TABLE>
<TR>
<TD>Name</TD>
</TR>

<TR>
<TD>
PLEASE READ THE FOLLOWING NOTES
<BR>
<UL>
<LI>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
</LI>
</UL>
</TD>
</TR>
</TABLE>
</DIV>

<!-- First Page Break for Printer -->

<P></P>

<DIV>
<TABLE>
<TR>
<TD>Page 2 Title</TD>
<TD></TD>
</TR>
</TABLE>
</DIV>

<P></P>

<DIV align=center>
<TABLE>
<TR>
<TD COLSPAN=2>Rows of Data</TD>
</TR>
</TABLE>
</DIV>

<!-- Second Page Break for Printer -->

<P></P>

<DIV>
<TABLE>
<TR >
<TD>Page 3 Title</TD>
<TD></TD>
</TR>
</TABLE>
</DIV>

<P></P>

<DIV align=center>
<TABLE>
<TR>
<TD>More Rows of Data</TD>
</TR>
</TABLE>
</DIV>
</BODY>
</HTML>

================================

I just need to be able to set 'Printer Breaks' as shown by the comment lines.

Thanks

Gary

MotherNatrsSon
08-20-2003, 11:14 PM
OK. in the <div> tag you want the page break after, it should look like this

<div style="page-break-after: always">

and assuming that you want the text aligned center on those it would be this:

<div style="text-align: center; page-break-after: always">

MNS

Gary Williams
08-21-2003, 09:47 AM
Hi MNS,

That did it! Page breaks are now working fine.

Many thanks

Gary