如何使用python-docx设置单元格边框 [英] How to setup cell borders with python-docx

查看:250
本文介绍了如何使用python-docx设置单元格边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用python-docx在表格中设置单元格边框,但找不到方法.请帮忙.

I need to setup cells borders in table with python-docx, but can't find how to. Please help.

推荐答案

看看发布在 git .

您可以使用一些默认的表格样式:

You can use some default table style:

table = document.add_table(rows, cols)
table.style = 'TableGrid'

这篇关于如何使用python-docx设置单元格边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆