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))
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))