[reportlab-users] Fitting the area ( table cells for example ) with text

Paul Barrass paul.barrass at safeonlinebilling.com
Mon Feb 2 14:23:11 EST 2009


Farid Adigamov wrote:

> Hello!

> I'm fitting the area ( table cells for example ) with text.

> How could it be done? Is it possible?

> For example I have the text:

>

> a = "HAVE A NICE DAY"

>

> I have to put it to the cell of table, but don't know how long is the

> string.

> What steps are possible in this situation?

You could either:

[for tables only] not specify the column widths, so the column will
expand to the size required to fix the text (which can lead to tables
wider than the page)
Place the text into a Paragraph() to enable word-wrapping.
Wrap the text (or a Paragraph() containing the text) into a
KeepInFrame() which can either (by default) shrink or crop it's contents
to fit.

Hope one of the above helps you out.

Paul Barrass.


More information about the reportlab-users mailing list