[reportlab-users] How to wrap text in a column in a table?
Kevin D Smith
Kevin.Smith at sixquickrun.com
Wed Nov 25 18:12:45 EST 2009
If you used Paragraph instances rather than strings/numbers for you
data in the table, I believe it will do what you want.
On Nov 25, 2009, at 5:05 PM, Michael Rowan wrote:
> 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)
> elements.append(table)
>
>
> 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?
>
> TIA
>
> Michael Rowan
> mike.rowan at internode.on.net
>
> 11 Kingscote Street
> ALBERTON
> South Australia 5014
>
> tel 618 8240 3993
>
>
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
Kevin D Smith
Kevin.Smith at sixquickrun.com
More information about the reportlab-users
mailing list