Setting the table size in reportlab

Asked by At

I have a lot of different tables to create in one PDF document, all with difeerent amount of columns. Can you set the table to a certain size? At the moment some are larger then the pagesize and columns are missing and some are much smaller and just fill half a page.

def v2(lc):
                t=Table(lc)
                t.setStyle(TableStyle([('SPAN', (0, 1), (-1, 1)),('FONTSIZE',(0,1),(-1,1),15),
                                       ('ALIGN',(0,3),(-1,3),'CENTER'),
                                       ('INNERGRID', (0,3), (-1,-1), 0.25, colors.black),
                                       ('BOX', (0,3), (-1,-1), 1, colors.black)
                                       ]))
                elements.append(t)
                elements.append(PageBreak())

0 Answers