如何使用Python Docx更改表中的线厚度
Line thickness 1 within a table
Line thickness 2 within a table
I am currently trying to change the line thicknesss of a table within a Microsoft word document. The table comes with a default line thickness of 1 pt, I am trying to find a way to change the line thickness to 2pt using python docx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置表/单元边框的文档可在此处提供: http://officeopenxml.com/wptpableborders.php
我已经重用可用的现有代码设置在此处回答的表单元边框 a>并将其修改为设置单个表属性。这将设置表中所有边界的统一属性,并将其存储在表级别(而不是在单个单元格级别):
documentation for setting table/cell border is available here: http://officeopenxml.com/WPtableBorders.php
i've reused the existing code available to set table cell border answered here https://stackoverflow.com/a/49615968/5736491 and modified it to set single table property. this will set the uniform property for all borders within the table, and it is stored at the table level (instead of at the individual cell level):