[reportlab-users] How to wrap text in a column in a table?

Michael Rowan mike.rowan at internode.on.net
Wed Nov 25 18:05:07 EST 2009

Repeat enquiry - no bites last time.

Using Django and ReportLab. I am using the SimpleDocTemplate to
generate a number of reports. All is well, except that in all the
reports there is a column of text data that is capable of being too
long for the cell width. I need therefore to make that column wrap
whenever necessary.

My current table styling is taken straight out of the docs:
ts = [('ALIGN', (0,0), (-1,-1), 'LEFT'),
('LINEABOVE', (0,0), (-1,0), 1, colors.purple),
('LINEBELOW', (0,-1), (-1,-1), 1, colors.purple),
('FONT', (0,0), (-1,-1), 'Times-Bold')]

table = Table(data, 1*[0.75*inch]+1*[6.0*inch], style=ts)

I assume there is a blindingly obviously way to cause this, but I
haven't seen it yet. Can anyone tell me how to do it?


Michael Rowan
mike.rowan at internode.on.net

11 Kingscote Street
South Australia 5014

tel 618 8240 3993

More information about the reportlab-users mailing list