[reportlab-users] Automatic column spacing in nested tables?

Robin Becker robin at reportlab.com
Fri Mar 16 10:01:36 EDT 2007

Dinu Gherman wrote:

> Hi,


> I'm just doing some fundamental table testing and wonder if the auto-

> matic column width calculation I'm observing for nested tables does

> the right thing?


> In the lower table of the attached sample I see too much white space

> on the right side of the cells. Apparently, the table seems to fill

> the whole frame width (minus some padding) in the document. But in

> the upper table this is ok, though.


> Regards,


There have been many discussions on this subject before. Many flowables have no
natural width so our simple algorithm effectively gives up; I believe it is
slightly cleverer than before and doesn't crash out with tables in tables so often.

Conceivably a Table could pursue a depth first strategy to completion, but if
the lower level flowables contain a paragraph which is naturally unsized then no
benefit will be obtained over the myopic algorithm if the size propagates outwards.

Someone contributed patches to make the distribution of unsizedness more fair,
but without a notion of goodness for the whole (outer) table there's no right
way to do this. I guess that Dinu would prefer the extra space in his example to
be removed in this particular case. That might be possible, but I'm not holding
my breath.
Robin Becker

More information about the reportlab-users mailing list