[reportlab-users] Keeping rows of a table together?

Andy Robinson reportlab-users@reportlab.com
Mon, 16 Jun 2003 06:59:53 +0100


> Now, the problem is that when Flowable.split() is called to break 
> the table 
> across page boundaries, the three rows that make up each delivery often 
> appear on separate pages, which is rather ugly.

There's a lazy way to do it.  Make an outer big table with ONE 
column.  Inside the first row put a 3-column, 1-row table with your
headers.  This will then repeat on each page. Then, make a separate
3-row, 3-column table for each of your deliveries and put it in the single
cell of the next row down.  I THINK this will work.  If not and
it splits the second-level tables, then make the second level
tables 3 distinct one-row objects with the same style and put a
KeepTogether around them.

> Any ideas?  Could I, perhaps, create a subclass of platypus.Table and 
> override the split() method in some way?
If you were brave, yes :-)

- Andy