摘要: import pandas from docx import Document excel=pandas.read_excel(r'F:\word练习\数据.xlsx',header=None) 文件=Document(r'F:\word练习\a.docx') 表=文件.add_table(4,4) 阅读全文
posted @ 2020-07-04 23:15 马蹄哒哒 阅读(694) 评论(0) 推荐(0)
摘要: from docx import Document from docx import WD_PARAGRAPH_ALIGNMENT w=Documeent(r'F:\word练习\a.docx') #第一种方法 t=w.add_table(3,3) t.cell(0,0).text='李先生' #第 阅读全文
posted @ 2020-07-04 23:02 马蹄哒哒 阅读(317) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-07-04 22:42 马蹄哒哒 阅读(183) 评论(0) 推荐(0)
摘要: 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.getpar 阅读全文
posted @ 2020-07-04 22:34 马蹄哒哒 阅读(384) 评论(0) 推荐(0)