Skip to content

word table get

zmworm edited this page Mar 31, 2026 · 23 revisions

Word: Table - get

Returned attributes when getting table, row, and cell elements.

Table

Path: /body/tbl[N]

Returned Attributes

Key Type Description
cols integer Number of columns
style string Table style name
alignment string Table alignment (left, center, right)
width integer Table width (twips or percent)
indent integer Table indent from left margin (twips)
cellSpacing integer Cell spacing (twips)
layout string Table layout (fixed or auto)
padding.top integer Default cell top padding (twips)
padding.bottom integer Default cell bottom padding (twips)
padding.left integer Default cell left padding (twips)
padding.right integer Default cell right padding (twips)
border.top string Top border definition
border.bottom string Bottom border definition
border.left string Left border definition
border.right string Right border definition
border.insideH string Inside horizontal border definition
border.insideV string Inside vertical border definition
colWidths string Comma-separated column widths (twips)

Row

Path: /body/tbl[N]/tr[M]

Returned Attributes

Key Type Description
height integer Row height (twips)
height.rule string Height rule (exact); only emitted when rule is Exact
header boolean Repeat as header row on each page

Cell

Path: /body/tbl[N]/tr[M]/tc[K]

Returned Attributes

Key Type Description
shd string Cell shading fill color. Alias: fill
width integer Cell width (twips)
valign string Vertical alignment (top, center, bottom)
vmerge string Vertical merge (restart or continue)
gridspan integer Number of grid columns spanned
padding.top integer Cell top padding (twips)
padding.bottom integer Cell bottom padding (twips)
padding.left integer Cell left padding (twips)
padding.right integer Cell right padding (twips)
border.top string Cell top border definition
border.bottom string Cell bottom border definition
border.left string Cell left border definition
border.right string Cell right border definition
textDirection string Text direction (lrTb, tbRl, btLr)
nowrap boolean No text wrapping
alignment string Cell horizontal alignment
font string First-run font family name
size string First-run font size (with pt suffix)
bold boolean First-run bold formatting
italic boolean First-run italic formatting
color string First-run font color (hex)
underline string First-run underline style
strike boolean First-run strikethrough
highlight string First-run highlight color name

Example

officecli get report.docx /body/tbl[1]
/body/tbl[1] (Table) (4 children)
  cols: 3
  style: TableGrid
  alignment: center
  width: 9360
  layout: fixed
  border.top: single 4 auto
  border.bottom: single 4 auto
  border.insideH: single 4 auto
  border.insideV: single 4 auto
  colWidths: 3120,3120,3120
officecli get report.docx /body/tbl[1]/tr[1]
/body/tbl[1]/tr[1] (Row) (3 children)
  height: 360
  height.rule: exact
  header: true
officecli get report.docx /body/tbl[1]/tr[1]/tc[1]
/body/tbl[1]/tr[1]/tc[1] (Cell) (1 children)
  shd: 1F3864
  width: 3120
  valign: center

Based on OfficeCLI v1.0.28

Clone this wiki locally