如何解决在* .docx文件的标题中创建一个表
我有以下工作代码usinf destruct (le_lt_dec n a).
rewrite (leb_correct _ _ l).
rewrite (leb_correct_conv _ _ l).
destruct (eq_dec n 0).
rewrite (eqb_correct _ _ l).
rewrite (eqb_correct_conv _ _ l).
(0<=?f1)=true ->
(0=?f1)=true.
:
python-docx
现在,我想要一个表头中具有三列的表,而不是三个选项卡,但是我不知道从哪里开始以及如何做。
非常感谢
解决方法
records = (
(3,'Spam','Meow'),(7,'Eggs',(4,'Spam,spam,eggs,and spam','Meow')
)
table = document.add_table(rows=1,cols=3)
table.style = 'TableGrid' # apply styling
header_cells = table.rows[0].cells
header_cells[0].text = 'ID'
header_cells[1].text = 'Name'
header_cells[2].text = 'Cat'
for id,desc,meow in records:
row_cells = table.add_row().cells
row_cells[0].text = str(id)
row_cells[1].text = desc
row_cells[2].text = meow
document.save('Test.docx')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。