[reportlab-users] how to change only one row height in a table
2,570 views
Skip to first unread message
Mike Driscoll
unread,
Sep 12, 2013, 5:35:53 PM9/12/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to reportlab-users
Hi,
I need to change the row height of a single row in a table. So for example, say I have a Table object with 5 rows and I want to make the height of the 4th row smaller than all the others. How would I do that? I tried changing the padding values for that row to no effect. I also tried setting the leading value, but that didn't affect it either...not that I really thought that one would.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to reportl...@googlegroups.com, reportlab-users, ro...@reportlab.com
Hi Robin,
On Friday, September 13, 2013 4:33:53 AM UTC-5, Robin Becker wrote:
You need to set up a rowHeights list in the Table() creation.
So if you have nrows=len(data) do
rowHeights = nrows*[None] or rowHeights = nrows*[myStandardRowHeight]
rowHeights[3] = 5
tbl = Table(data,....rowHeights=rowHeights)
I thought about using rowHeights, but for some reason I was having trouble figuring out how to do it dynamically last night since I don't really know how many rows will be in the table ahead of time. Thanks for the tip. I don't think I've ever seen someone create a list like that before.