Keep Data Together on Page
From Relyimah
Problem: Keep-with-next, keep-with-previous, keep-together don't work.
Reason: These properties are not implemented on version 0.20.5 and earlier, except on table rows.
Solution: In order to take advantage of them, you have to nest stuff to be kept together in a table.
The concept is called “blind table”. The table is used for pure layout reasons and is not obvious in the output.
An example of an image and the image caption to be kept together:
<fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="proportional-column-width(1)"/> <fo:table-body> <fo:table-row keep-with-next="always"> <fo:table-cell> <fo:block> <fo:external-graphic src="foo.jpg"/> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Image Caption</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table>
Source: http://xmlgraphics.apache.org/fop/faq.html#keep-with
