CFDocument Formatting Quick Tip

So recently I have been messing around a bit more with the CFDocument tag and keeping sections together. As noted elsewhere on the internet there is no simple way of fixing this until I quite happily stumbled on a solution (in railo at least). Basically if a table is less than the total height of a page it will be kept together! Now all those people who tell you tables are evil and should not be used may jump in horror at what I suggest you do next, which is that you code your CFDocuments as follows:

<table><tr><td> ...Some HTML/CF output code that you don't want a page break in... </tr></td></table>

Now It is neither elegant or nice to code, but for some reason it seems to work. Hope this helps someone else!

About Simeon Cheeseman

I enjoy a wide variety of computer and board games, have a BSc in Computer Science and have played percussion for 18 years.

Posted on April 27, 2012, in ColdFusion, Railo and tagged , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: