Blog Archives

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!