[reportlab-users] Tables in landscape moving left

13 views
Skip to first unread message

Mike Driscoll

unread,
Jan 8, 2014, 1:42:17 PM1/8/14
to reportlab-users
Hi,

I am creating a Table flowable in Reportlab using a SimpleDocTemplate in landscape mode. I am trying to make the columns of the Table wide enough for the labels, and every time I make it a little wider, the table moves to the left. I am attaching a screenshot. I need to make several more of the table columns wider to fit the data and to make the table better cover the page.

I noticed that if I increase the leftMargin parameter for the template, it will push the table to the right, but there's got to be a better way, right?

Thanks!

-------------------
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
table.png

Andy Robinson

unread,
Jan 8, 2014, 2:04:19 PM1/8/14
to reportlab-users
Mike, I suspect the problem is that your table (like all others) is
centred in the frame by default. in most long documents (e.g. in word
processing), people like to see tables in the centre of the space. If
you had a small narrow table (say 4 inches wide in a 6 inch frame) you
would see this.

Try creating it like this or setting the 'hAlign="LEFT"' yourself, and
the left edge should stay put from then onwards.

t = Table(...., hAlign='LEFT')
> _______________________________________________
> reportlab-users mailing list
> reportl...@lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>



--
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel +44-20-8405-6420
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users

Mike Driscoll

unread,
Jan 8, 2014, 3:10:24 PM1/8/14
to reportl...@googlegroups.com, reportlab-users
Hi Andy,


On Wednesday, January 8, 2014 1:04:19 PM UTC-6, Andy Robinson wrote:
Mike,  I suspect the problem is that your table (like all others) is
centred in the frame by default.  in most long documents (e.g. in word
processing), people like to see tables in the centre of the space. If
you had a small narrow table (say 4 inches wide in a 6 inch frame) you
would see this.

Try creating it like this or setting the 'hAlign="LEFT"' yourself, and
the left edge should stay put from then onwards.

t = Table(...., hAlign='LEFT')

I almost tried that too. Thanks! That did the trick!

Mike
Reply all
Reply to author
Forward
0 new messages