摘要: 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 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(188) 评论(0) 推荐(0) 编辑