I want to push a paragraph to a new page if a page break occurs in the middle of a dynamically output paragraph.

rarid122481
rarid122481 used Ask the Experts™
on
I have a table that has dynamic output inside of a <cfloop query="qryCoverage"> tag. In the screenshot i am attaching, i have two dynamic fields qryCoverage.Coverage_Prior and  qryCoverage.Coverage_Modified that will output a paragraph as much as 1500 characters. I want ColdFusion, CSS or HTML to detect if a page break will occur inside of either of these fields and if so, push the entire paragraph to the next page. Is this possible? coldfusion dynamic table fields
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
How do you define "page break" when you say you want to test to see if a page break will occur within one of the paragraphs?   What are you testing for?   A certain number of characters having been displayed or has the user actually entered some type of symbol indicating that they want a page break at that point?


HTML doesn't have "page breaks" as the page usually just scrolls, so you need to define how you know when a page break should occur and then test for it.






Author

Commented:
when i print this document out as a pdf, i dont want either of the pargraphs to be cut off in the middle  to where a portion of the paragraph is on one page and the rest of the paragraph is on the next page.

ahhh, so that's the secret !   You talking about using CFDOCUMENT to create a PDF file.

So cfdocument is not that intelligent, you actually have to estimate how many characters will fit on a page and then count the characters in your text to see if it will fit or not.  

I do this with table output.  I have to estimate the height of each line of data and count the number of rows, then put in a manual page break.

I would start by generating a string of characters that will fill the page, then use len() to see how long it is.  That's your page length in characters (which is only an estimate).

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial