python - 如何在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])
推荐阅读
- javascript - 使用 dockerode 在 docker 容器中运行 java 代码
- caddy - 如何在 Caddy 中将 /api/a/b/c 重写为 d.com/a/b/c
- python - 为训练 Tensorflow 网络提供 spark 数据帧的最佳实践
- android - Cordova/Ionic/PhoneGap 应用程序中可用的 CSS 和 Javascript 功能?
- ruby - 方法调用如何与运算符优先级交互?
- javascript - 如何使用材料表中的表行数据添加带有处理程序启用/禁用的开关
- r - 将变量名称列表作为参数传递给 R 函数
- flutter - Flutter firebase_message 插件设置错误
- flutter - 大文本上的 Flutter DropdownButtonFormField 溢出
- java - 如何在 Maven 多模块项目中添加 test-jar 和 jar 作为依赖项?