首页 > 其他 > 详细

删除单元格,列,行

时间:2020-07-05 23:20:29      阅读:64      评论:0      收藏:0      [点我收藏+]
from  docx  import  Document
word=Document(r    )
tale=word.tables[0]
#第一种删除单元格的方法
table.cell(0,0).text=""
#第二种删除单元格的方法
paragraph=table.cell(0,1).paragraphs[0].text=""


#删除一行
for  cell in table.rows[0].cells:
    cell.text=""

#删除一列
for cell  in  table.columns[0].cells:
    cell.text=""

word.save(r   )

 

删除单元格,列,行

原文:https://www.cnblogs.com/luckiness/p/13252095.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!