|
| |
|
|
BeamMeUp
Posts: 12 From: None Status: offline
|
Page Break Script - 6/13/2002 10:55:17
Does anyone know if it is possible to have a script automatically create page breaks in a long html document that contains tables and photos, so that when printing one page or the entire document, the photos and/or a line of text is not split in two. I know how to manually insert the page-break tag but this will need to generate correct printing pages based on what is selected, or the entire document.
|
|
|
|
Mojo
Posts: 2429 From: Chicago Status: offline
|
RE: Page Break Script - 6/13/2002 11:11:36
The following code will force a pagebreak in CSS2: <P style="page-break-after: always"> You may want to look into this attribute because there is more to it...
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: Page Break Script - 6/13/2002 13:45:09
Yes it is possible. I do it on a form results for a census form that gets emailed. Each page holds 13 clients. The relevant portion of the page I use looks something like: '-------------------- Build pages recursively FOR pageNumber = 1 to totalPages '-------------------- Display user info on each page strText = strText & "<p CLASS='page' align='center> </p>" & vbcrlf & "<p align='right'><font face='Arial' size='2'>Page # " & pageNumber & "</font></p>" & vbcrlf strText = strText & "<p align='center'><font face='Arial' size='4'>Group Census<br>Confidential List of All Eligible Employees</font></p>" & vbcrlf strText = strText & userInfoTable & "<br>" '-------------------- Begin employee info table strText = strText & "<div align='left'><table border='1' cellpadding='2' cellspacing='0' width='895' columns='10'>" & vbcrlf '-------------------- Display table header strText = strText & tableHeader '-------------------- Build table of employees by retrieving array items FOR e = 0 to 12 f = (((pageNumber - 1) * 13) + e) IF f <= upper THEN strText = strText & arrEmployees(f) ELSE END IF NEXT strText = strText & "</table></div>" & vbcrlf '-------------------- Next page NEXT and I had a line like this in my <style> section: p.page { page-break-before: always } (I just break before instead of after for personal preference ) The full code of the page can be seen here: http://www.clarkinsurance.com/cdonts_example.htm but the whole page is primarily a CDONTS script to send HTML mail. It gets a little involved using arrays and such, but the code showing the recursive use of the page break is above. Any help???
|
|
|
|
ahaynes106
Posts: 7 Joined: 8/1/2005 Status: offline
|
RE: Page Break Script - 8/10/2005 18:48:59
quote:
<P style="page-break-after: always"> do you need anything else? I stuck that in my code where I wanted the page break to oocur, but nothing. It just printed past that point until the page filled up and overflowed to the next page.
|
|
|
|
ahaynes106
Posts: 7 Joined: 8/1/2005 Status: offline
|
RE: Page Break Script - 8/19/2005 13:15:35
I found these on MozillaZine Forums. Finally, something that worked for me on Firefox and IE. Not sure why the others worked in IE but not Mozilla. This works: <p> ... </p> <br style="page-break-before: always;" clear="all" /> This works: <div> ... </div> <p><br style="page-break-before: always;" clear="all" /></p> And this works: <div> ... </div> <br style="page-break-after: always;" clear="all" />
|
|
|
|
d a v e
Posts: 4013 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: Page Break Script - 5/8/2008 8:56:12
you do have a print stylesheet don't you?!
_____________________________
David Prescott Gekko web design
|
|
|
|
d a v e
Posts: 4013 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: Page Break Script - 5/8/2008 10:11:20
dang - got me too! and the original post was in 2002!
_____________________________
David Prescott Gekko web design
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|