-
Notifications
You must be signed in to change notification settings - Fork 542
word table add
zmworm edited this page Apr 9, 2026
·
52 revisions
Add tables, rows, and cells to the document.
Parent: /body
| Property | Default | Description |
|---|---|---|
rows |
1 |
Number of rows |
cols |
1 |
Number of columns |
colWidths |
auto | Comma-separated widths (twips) |
alignment |
- |
left, center, right
|
width |
- | Width (twips or percentage, e.g. 100%) |
layout |
- |
fixed, auto
|
style |
- | Table style (e.g. TableGrid, with TableLook for banding) |
border.all |
single |
Default borders |
border.top, border.bottom, border.left, border.right
|
- | Individual borders |
border.insideH, border.insideV
|
- | Inside borders |
indent, cellSpacing, padding
|
- | Spacing |
# Add a 3x4 table
officecli add report.docx /body --type table --prop rows=3 --prop cols=4
# Add styled table
officecli add report.docx /body --type table --prop rows=5 --prop cols=3 --prop style=TableGrid --prop alignment=centerParent: /body/tbl[N]
| Property | Default | Description |
|---|---|---|
cols |
from grid | Cell count |
height |
- | Row height (twips or with unit: 1.5cm, 0.5in, 36pt) |
height.exact |
- | Exact row height (twips or with unit) |
header |
- | Repeat row as header |
c1, c2, c3, ... |
(empty) | Cell text by position |
officecli add report.docx /body/tbl[1] --type row --prop c1="Name" --prop c2="Value" --prop c3="Total"Cells are created automatically when adding rows. To add content within a cell, add paragraphs or runs to the cell path.
officecli add report.docx /body/tbl[1]/tr[1]/tc[1] --type paragraph --prop text="Cell content"Based on OfficeCLI v1.0.40