02 2024 档案

python word 删除表格的指定列
摘要:from docx import Documentfrom docx.shared import Cmdef delete_columns(path, table_n, column_n): """ 删除一列 :param path: 路径 :param table_n: 第几个表格 :param 阅读全文

posted @ 2024-02-01 16:55 郭峰g 阅读(159) 评论(0) 推荐(0) 编辑

python word 设置表格居中
摘要:from docx import Documentdef align_table(doc_path): # 打开文档 doc = Document(doc_path) # 遍历文档中的所有表格 table = doc.tables[0] # 遍历表格的行 for row in table.rows: 阅读全文

posted @ 2024-02-01 16:54 郭峰g 阅读(323) 评论(0) 推荐(0) 编辑

python word 表格插入一行数据
摘要:import docxdef insert_row(path, table_n, row_index, s_col_index,e_col_index,content): """ 插入行 :param path: 路径 :param table_n: 第几个表格 :param row_index: 阅读全文

posted @ 2024-02-01 16:54 郭峰g 阅读(422) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示