如何在reportlab中调整特定单元格的大小



我想缩小特定单元格的大小。我尝试了以下代码,但它会调整每一列的大小。

table = Table(data, colWidths=[1.9*inch] * 5)

我还在style表中尝试了此代码

style = TableStyle([
('colWidths', (3, 3), (3, 3), 0.5*cm )
])

但它不起作用。

如何调整特定单元格的大小,例如单元格编号3,3

您是否尝试将列表传递给不同大小的colWidths和/或rowHeights?类似于:

table = Table(data, colWidths=[2, 2, 2, 1, 2, 2], 
rowHeights=[2, 2, 2, 1, 2, 2])

最新更新