from docx import Document w=Document(r'F:\word训练\表格.docx') table_1=w.tables[0] #删掉行 print(len(table_1.rows)) row2=table_1.rows[1] row2._element.getparent().remove(row2._element) print(len(table_1.rows)) #删掉列 col=table_1.table.columns[1] for cell in col.cells: cell._element.getparent().remove(cell._element) w.save(r'F:\word训练\删掉表格的行或是列.docx')
本文版权归QU快排Www.seoGurubLog.com 所有,如有转发请注明来出,竞价开户托管,seo优化请联系QQ▲61910465