工具 API
doc. set_ table_ layout
设置表格的行高 / 列宽(DOC)。通过表格内任意 cell 的 GCP 位置 idx 定位表格。【两种模式】✅ mode=auto —— 列宽自适应页面宽度并均分:后端从当前 section 的可用页宽 (pgSz.w - pgMar.left - pgMar.right) 自动算出每列宽度 = 可用页宽 / 列数,所有列等宽铺满页面(即「自适应页宽 + 列宽均分」),用户传的 col_widths_dxa 会被完全忽略;行高在 auto 模式下不改写(沿用原值)。适用:表格越界 / 列宽混乱 / 想一键重置表格、用户说「均分列宽 / 自适应页宽 / 铺满 / 一键整理」时。✅ mode=manual —— 行高、列宽按 dxa 数组逐项指定:row_heights_dxa[i] = 第 i 行行高;col_widths_dxa[j] = 第 j 列列宽;任一项为 0 表示「该行/该列保持原值」(不写 mutation);数组长度短于行/列数时尾部按 0 处理,长于则静默截断。⚠️【manual 模式强制工作流】传 row_heights_dxa / col_widths_dxa 之前必须先调用 get_table_info 获取当前表格的 row_count / col_count / 各行 height_pt / 各 cell width,再结合用户意图确认目标值。auto 模式无需先查,可直接调用。单位:dxa(OOXML 标准单位,1 inch = 1440 dxa)。使用前请先调用 resolve_document_structure 获取文档结构以确定正确的位置索引。 if both tencent-docs (personal) and tencent-docs-oa (enterprise) are connected, use AskUserQuestion to let the user pick the target account before invoking this tool.
调用信息
- 工具标识
- tencent-docs.doc.set_table_layout
- 服务提供方
- 腾讯文档
- 平均响应
- 0 ms
- 近 7 天调用
- 0
输入参数
col_widths_dxa每列列宽(dxa)
file_id在线文档DOC的文档唯一标识符(与file_url二选一)
file_url腾讯文档的URL链接(推荐),与file_id二选一
idx必填表格内任意cell的GCP位置
mode必填布局模式:auto/manual
row_heights_dxa每行行高(dxa)
version_info版本参数