Text Doc
Tables
This group of instructions builds and edits tables in a document: creating a table, writing the text of its cells, adding or deleting rows and columns, merging and splitting cells, setting column widths and row heights, applying borders, background colors, alignment, and built-in table styles, marking header rows, sorting rows, and fitting the table to its content or the page.
Prerequisite: before using any of these instructions, the workflow must already have a DOCX document created or opened (with Create text doc), which these instructions will act upon.
These concepts recur across every instruction in this group; they are explained here once.
-
Document: indicates which document in the workflow the instruction applies to. If left empty, the current document is used.
-
How tables, rows, and columns are located: they are referred to by a position number that starts at 1 — the first table in the document is Table number
1, the first row is Row number1, the first column is Column number1, and so on. If a Table number, Row number, or Column number points to something that does not exist, the instruction simply does nothing. -
Saving the new table’s position: Insert Table can save the position number of the table it creates under a name (Save table number in), so later instructions can target it through their Table number (from variable) field without you having to count tables by hand.
-
The value
-1means “all” or “at the end”: a few fields accept-1to act on a whole axis at once — Set Column Width with Column number-1changes all columns, Set Row Height with Row number-1changes all rows — or to append — Add Row with Row number-1and Add Column with Column number-1add the new row/column at the end. -
Which cells an instruction affects (Target): Apply Borders, Apply Background Color, and Align Cell Content have a Target field with four choices:
table= every cell in the table;row= every cell in the row given by Row number;column= the cell at Column number in every row;cell= the single cell at Row number + Column number. Anything else is treated ascell. -
Dynamic values (
@name): in any text field you can type@followed by the name of a value saved earlier in the workflow, and it will be replaced by that value. For example, if you saved a color inbrandColor, you can type@brandColorin the Color field. -
Saving a result: some instructions offer a field to save a value they produce (the new table’s position, the resulting row count, or column count) under a name, so you can reuse it later. If left empty, nothing is saved.
-
Measurement units and colors: column widths, row heights, and cell widths are given in centimeters (cm); border thickness is given in points (pt); colors are given as hex codes (for example
FFFF00for yellow), with or without a leading#. -
“From variable” fields: the
@nametrick only works in text fields. So that a numeric field (like Table number, Row number, Width (cm), or Thickness (pt)) or a yes/no field (like Ascending) can also take its value from a saved value, each one has a companion “from variable” field:- If you leave it empty, the value typed in the normal field is used.
- If you fill it in with the name of a saved value, the engine ignores the normal field and uses that variable’s value.
This is mainly for chaining instructions. For example, an Insert Table instruction can save the new table’s position; a following Add Row whose Table number (from variable) points at that value then adds a row to exactly that table, without you having to know its number in advance. If you only work with fixed values, you can ignore these fields.
- Add Column .docx
- Add Row .docx
- Align Cell Content .docx
- Apply Background Color .docx
- Apply Borders .docx
- Apply Table Style .docx
- Delete Column .docx
- Delete Row .docx
- Delete Table .docx
- Fit Table .docx
- Format Cell Text .docx
- Insert Table .docx
- Iterate Rows .docx
- Merge Cells .docx
- Prevent Row Page Break .docx
- Set Column Width .docx
- Set Header Row .docx
- Set Row Height .docx
- Set Table Cell .docx
- Sort Table Rows .docx
- Split Cell .docx
Add Column .docx
Inserts a new empty column to the left or right of an existing column, or at the end of the table.
When to use it: to widen a table with an extra column without rebuilding it.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Column number | Position number of the reference column; -1 appends at the end |
-1 (end) |
No |
| Position | Insert to the Left (before) or the Right (after) of the reference column (ignored when appending) |
after (Right) |
No |
| Width (cm) | Width of the new column in centimeters | 3 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Width (from variable) | Reads the width from a saved value | (empty) | No |
| Save column count in | Name under which to save the table’s new column count | (empty) | No |
Important behavior: if the table does not exist, nothing happens. A Column
number of -1 (the default) appends the new column at the end, ignoring
Position. With a Column number of 1 or more, the column goes to the left or
the right of it, as chosen. Add Row uses this same index + position model,
with Above and Below instead of Left and Right.
Add Row .docx
Inserts a new empty row above or below an existing row, or at the end of the table.
When to use it: to append a new record to a table, or to insert a row in the middle.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Position number of the reference row; -1 appends at the end |
-1 (end) |
No |
| Position | Insert Above (before) or Below (after) the reference row (ignored when appending) |
after (Below) |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Save row count in | Name under which to save the table’s new row count | (empty) | No |
Important behavior: if the table does not exist, nothing happens. The new
row copies the column count and column widths of the table’s first row. A Row
number of -1 (the default) appends the row at the end, ignoring Position;
so does asking for Below the last row. This is the same index + position
model as Add Column — the two instructions are twins, with Above/Below here
and Left/Right there.
Align Cell Content .docx
Sets the horizontal and vertical alignment of the content in one cell or in every cell of the table.
When to use it: to center headings, right-align numbers, or vertically center the text in cells.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Target | table = every cell; row = the whole Row number; column = the whole Column number; cell = one cell |
table |
No |
| Row number | Row used by Target row and cell |
1 |
No |
| Column number | Column used by Target column and cell |
1 |
No |
| Horizontal | Horizontal alignment: left, center, or right. Supports @name |
left |
No |
| Vertical | Vertical alignment: top, center, or bottom. Supports @name |
top |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. An
out-of-range Row number (for row/cell) or Column number (for
column/cell) does nothing. An unrecognized Horizontal value falls back to
left, and an unrecognized Vertical value to top.
Apply Background Color .docx
Fills the background of one cell or of every cell in the table with a color.
When to use it: to shade a header row, or to color a single cell for emphasis.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Target | table = every cell; row = the whole Row number; column = the whole Column number; cell = one cell |
table |
No |
| Row number | Row used by Target row and cell |
1 |
No |
| Column number | Column used by Target column and cell |
1 |
No |
| Color | Background color as a hex code (for example FFFF00). Supports @name |
FFFFFF (white) |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. An
out-of-range Row number (for row/cell) or Column number (for
column/cell) does nothing. The color may be written with or without a
leading #. An empty Color applies nothing.
Apply Borders .docx
Applies borders to the whole table or to a single cell, with a chosen line style, thickness, and color.
When to use it: to add or restyle the grid lines of a table, or to outline one cell.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Target | table = the whole table; row = every cell in Row number; column = the cell at Column number in every row; cell = one cell |
table |
No |
| Row number | Row used by Target row and cell |
1 |
No |
| Column number | Column used by Target column and cell |
1 |
No |
| Style | Line style: single, double, dotted, thick, or none. Supports @name |
single |
No |
| Thickness (pt) | Border thickness in points | 0.5 |
No |
| Color | Border color as a hex code (for example 000000). Supports @name |
000000 (black) |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Thickness (from variable) | Reads the thickness from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. With
Target table the borders apply to all four outer sides plus the inner grid
lines; with row, column, or cell the four sides are set on each affected
cell (an out-of-range row or column does nothing). An unrecognized Style falls
back to single. The color may be written with or without a leading #.
Apply Table Style .docx
Assigns a built-in table style to the table by its style ID.
When to use it: to give a table a ready-made look (banded rows, shading, borders) in one step.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Style ID | ID of the built-in table style (for example TableGrid, LightShading). Supports @name |
TableGrid |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
Important behavior: if Style ID is empty, or the table does not exist, nothing happens.
The style has to exist in the document. A document this workflow creates carries no
style definitions at all, so naming TableGrid writes the reference and leaves the table
as it was. Define it first with Create Style .docx, or bring the styles of another file
with Copy Styles From Document .docx; a document opened from disk already carries its
own. When the style is missing the run says so, naming the styles the document does have,
and validate warns before running.
Delete Column .docx
Removes a column from a table by its position number.
When to use it: to drop a column you no longer need.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Column number | Position number of the column to remove | 1 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Save column count in | Saves how many columns the table has left after the deletion | (empty) | No |
Important behavior: if the table or the column does not exist, nothing happens. If Save column count in is filled, the number of columns remaining is stored under that name (the same way Add Column reports it).
Delete Row .docx
Removes a row from a table by its position number.
When to use it: to delete a specific record from a table.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Position number of the row to remove | 1 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Save row count in | Saves how many rows the table has left after the deletion | (empty) | No |
Important behavior: if the table or the row does not exist, nothing happens. If Save row count in is filled, the number of rows remaining is stored under that name (the same way Add Row reports it).
Delete Table .docx
Removes an entire table from the document by its position number.
When to use it: to delete a whole table.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table to remove (starts at 1) | 1 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens.
Fit Table .docx
Resizes the table to fit its content or to fill the space between the page margins.
When to use it: to shrink a table to just what its content needs, or to stretch it to the full width of the page.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Mode | content = fit to content; margin = full page width. Supports @name |
margin |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. Any Mode
other than content is treated as margin.
Format Cell Text .docx
Formats the text already written in one cell of a table: bold, italic, underline, color, typeface, and size.
When to use it: to highlight the header row or a total after filling the table with Set Table Cell. The formatting instructions of Text content pick the text by searching for it in the whole document; this one points at the cell by its position, like the rest of the table instructions.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Row of the cell (starts at 1) | 1 |
No |
| Column number | Column of the cell (starts at 1) | 1 |
No |
| Bold | true turns it on, false turns it off, empty leaves it as it is |
(empty) | No |
| Italic | true turns it on, false turns it off, empty leaves it as it is |
(empty) | No |
| Underline | true turns it on, false turns it off, empty leaves it as it is |
(empty) | No |
| Color hex | Text color, 6 hex digits without #. Empty = no change. Supports @name |
(empty) | No |
| Font name | Typeface of the text. Empty = no change. Supports @name |
(empty) | No |
| Font size pt | Size in points. 0 = no change |
0 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Font size pt (from variable) | Reads the size from a saved value | (empty) | No |
Important behavior: the format travels with the text, so a cell with no text yet has nothing
to format — write it first with Set Table Cell, which keeps the formatting of what was already
there. Every attribute left empty (or 0) is left as it is, so several calls stack up instead of
resetting one another. A table, row, or column that doesn’t exist is not an error: the instruction simply
does nothing.
Insert Table .docx
Creates a new empty table with the given number of rows and columns.
When to use it: to add a fresh table to the document, either after a specific paragraph or at the end.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Rows | Number of rows | 3 |
No |
| Columns | Number of columns | 3 |
No |
| Search text | The table is placed after the paragraph containing this text; empty = end of document. Supports @name |
(empty) | No |
| Column width (cm) | Width of each column in centimeters | 3 |
No |
| Case sensitive | Whether the Search text match is case-sensitive | No | No |
| Rows (from variable) | Reads the number of rows from a saved value | (empty) | No |
| Columns (from variable) | Reads the number of columns from a saved value | (empty) | No |
| Column width (from variable) | Reads the column width from a saved value | (empty) | No |
| Case sensitive (from variable) | Reads the yes/no value from a saved value | (empty) | No |
| Save table number in | Name under which to save the new table’s position number | (empty) | No |
Important behavior: Rows and Columns are each treated as at least 1.
If Search text is empty, or no paragraph contains it, the table is added at
the end of the document. The new table starts with single-line borders on
all sides.
Iterate Rows .docx
Publishes the rows of a table into a variable, so a For Each can walk them one by one.
When to use it: to read a table that is already in the document — totalling a column, copying its rows elsewhere, or deciding something per row.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Use first row as header | Yes: the first row names the fields and is not a turn. No: the fields are column1, column2… and every row is a turn |
true |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Use first row as header (from variable) | Reads that yes/no from a saved value | (empty) | No |
| Save key | Name of the variable that receives the rows. Empty = the instruction does nothing useful | (empty) | No |
| Save count key | Name of the variable that receives how many rows there are | (empty) | No |
Important behavior: the turns are a copy taken when the instruction runs: what the loop walks does not change if the body edits the document. To leave a result back in the row, write it by position — the Index of the For Each feeds the “(from variable)” field of the writing instruction. In this format that instruction is Set Table Cell, whose Row number (from variable) takes the loop’s index — remember that with a header row the first turn is row 2 of the table.
Merge Cells .docx
Merges a rectangular block of cells into one.
When to use it: to create a heading cell that spans several columns, or to join cells vertically.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Start row | Top row of the block to merge | 1 |
No |
| Start column | Left column of the block to merge | 1 |
No |
| End row | Bottom row of the block to merge | 1 |
No |
| End column | Right column of the block to merge | 2 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Start row (from variable) | Reads the start row from a saved value | (empty) | No |
| Start column (from variable) | Reads the start column from a saved value | (empty) | No |
| End row (from variable) | Reads the end row from a saved value | (empty) | No |
| End column (from variable) | Reads the end column from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. Start
row and Start column are treated as at least 1. Cells are merged across
columns within each row and, when the block spans several rows, down the rows as
well.
Prevent Row Page Break .docx
Keeps a row from being split in two by a page break: if it does not fit on the page, the whole row moves to the next one.
When to use it: when a table falls across a page break and a row is left cut in half, or to keep a totals row whole at the end of a report.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Row to protect; -1 protects every row |
-1 (all) |
No |
| Prevent | Yes = the row cannot be split; No = removes the protection | Yes | No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Prevent (from variable) | Reads the yes/no value from a saved value | (empty) | No |
Important behavior: if the table or the row does not exist, nothing happens. This does not keep the table together — each row is protected on its own, so a table longer than the page still continues on the next one, only without cutting a row through the middle. It is the word processor that decides where the page ends, so the effect is only visible once the document is opened.
Set Column Width .docx
Sets the width, in centimeters, of one column or of every column in the table.
When to use it: to give columns a specific width, or to make all columns the same width.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Column number | Column to resize; -1 resizes all columns |
-1 (all) |
No |
| Width (cm) | New column width in centimeters | 3 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Width (from variable) | Reads the width from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. A Column
number of -1 applies the width to every column.
Set Header Row .docx
Marks the first rows of a table as header rows that repeat at the top of every page the table spans.
When to use it: for long tables that break across pages, so the column headings reappear on each page.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Header row count | How many rows from the top are header rows | 1 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Header row count (from variable) | Reads the header row count from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. The count is capped at the number of rows in the table. Rows beyond the header count have any previous header mark removed.
Set Row Height .docx
Sets the height, in centimeters, of one row or of every row in the table.
When to use it: to make rows taller for readability, or to fix an exact row height.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Row to resize; -1 resizes all rows |
-1 (all) |
No |
| Height (cm) | Row height in centimeters | 1 |
No |
| Height type | atLeast = a minimum that can grow with content; exact = a fixed height. Supports @name |
atLeast |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Height (from variable) | Reads the height from a saved value | (empty) | No |
Important behavior: if the table does not exist, nothing happens. A Row
number of -1 applies the height to every row. Any Height type other than
exact is treated as atLeast.
Set Table Cell .docx
Writes the text of one cell of a table.
When to use it: to fill in a table. Insert Table creates the table empty, so this is the instruction that puts content in it — one cell at a time, usually inside a For Each.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Row of the cell (starts at 1) | 1 |
No |
| Column number | Column of the cell (starts at 1) | 1 |
No |
| Text | Text to write in the cell. Supports @name |
(empty) | No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
Important behavior: the text given replaces everything the cell had. An empty text is not ignored: it empties the cell, because in a cell the text is the content (the same as Write Cell Value in a spreadsheet). The formatting of the text that was in the cell — bold, font, color — is kept and applied to the new text, and so is the alignment set with Align Cell Content. A table, row or column that doesn’t exist is not an error: the instruction simply does nothing.
Sort Table Rows .docx
Sorts the rows of a table by the text in one column, keeping a chosen number of header rows fixed at the top.
When to use it: to order a table alphabetically or numerically by one of its columns.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Column number | Column whose text is used to sort | 1 |
No |
| Ascending | Yes = A→Z / 0→9; No = Z→A / 9→0 | Yes (ascending) | No |
| Header rows | Number of top rows kept in place and excluded from sorting | 1 |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Ascending (from variable) | Reads the yes/no value from a saved value | (empty) | No |
| Header rows (from variable) | Reads the header row count from a saved value | (empty) | No |
Important behavior: if the table does not exist, or Header rows is equal to
or greater than the number of rows, nothing happens. The order is chosen from the column’s first
non-blank value: a number sorts by value (so 9 comes before 10), a date by date,
and anything else as text ignoring upper/lower case. The result never depends on the
language settings of the computer running the workflow.
Split Cell .docx
Splits a single cell into several cells, either across columns or down into new rows.
When to use it: to divide one cell into two or more, for example to break a merged cell back apart.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document | Document the instruction applies to | (current document) | No |
| Table number | Position number of the table (starts at 1) | 1 |
No |
| Row number | Row of the cell to split | 1 |
No |
| Column number | Column of the cell to split | 1 |
No |
| Parts | Number of pieces to split into | 2 |
No |
| Split into | columns = split within the same row; rows = split down into new rows. Supports @name |
columns |
No |
| Table number (from variable) | Reads the table position from a saved value | (empty) | No |
| Row number (from variable) | Reads the row position from a saved value | (empty) | No |
| Column number (from variable) | Reads the column position from a saved value | (empty) | No |
| Parts (from variable) | Reads the number of parts from a saved value | (empty) | No |
Important behavior: if the table, row, or cell does not exist, nothing
happens. Parts is treated as at least 2. With columns, the cell’s width is
divided among the new cells; with rows, new rows are added below and the other
columns are joined vertically to keep the table aligned.
This documentation is the help of the application, and it comes underCreative Commons Attribution 4.0.