删除表

python学习网 2020-07-05 10:17:01
from  docx  import  Document
w=Document(r'F:\word练习\表格.docx')

#删除表
print(len(w.tables))
t=w.tables[0]
t._element.getparent().remove(t._element)
print(len(w.tables))

 

阅读(2427) 评论(0)