I am trying to create a Invoice template using reportlab. For the line items in the invoice, I am using a Table. The first row of the table contains the headers and the subsequent rows will be the actual line items. What I basically want to achieve is that if the table contains only 1 line item (plus one row of header), the table should span the entire page.
How can that be done? I don’t see any way of specifying the height of the rows individually.
Thanks in advance.
You can achieve this using
TableStylesandSPANcommands. You can read more about how this works starting on page 81 of the ReportLab user manual. This will let you have cells span as many rows and columns as you want.You can also use
TableStylesto adjust things like the width and hight of each row and column, but from your description that doesn’t sound like what you really wanted to do.