Skip to main content

Block tags and tables

Block tags allow you to automatically show or hide a table or table rows.

⚠️ Practical information

We recommend reading the tutorial What are Block tags? first, in order to fully understand their role and how to use them.

The examples presented here use fictional identifiers. When putting this into practice, remember to replace them with those from your form.

⚠️ Important

The two block tags must be positioned consistently:

  • either both outside the table,

  • or both inside the table.

Furthermore, if the block tags are generated from the tag of a field present in a table, they must necessarily be placed in that same table.

1. Block tags outside a table

When both block tags surround a table (one before and one after), they control the display of the entire table.

1.1 Hiding a table if it is empty

Objective: hide the table if no field has been filled in.

Example:

Name of the Table field: Tableau
Table tag: ##table##

Fields contained in the table:

  • Date field: ##date##

  • Control point field: ##control##

  • Compliant choice field: ##compliant##

  • Comment text area: ##comment##

The block tags are built from the table tag ##_block:tableau##.

Place:

  • the opening tag above the table

  • the closing tag below the table

Result:

  • If at least one field is filled in → the table is displayed

  • If no field is filled in → the table is hidden

2. Block tags inside a table

When block tags are placed inside the table, they control the display of:

  • a row

  • or specific content

The fields contained in the table are as follows:

  • Date field: ##date##

  • Control point input field: ##control##

  • Compliant choice field: ##compliant##.

  • Comment text area: ##comment##

2.1 Conditioning the display of a cell's content

Objective: display a Choice field (or List field) with a different color depending on the selected value.

Example:

Choice field: Compliant

Tag: ##compliant##

ℹ️ Important

The items in the Choice field must be coded in the format code:label.

The codes are used in block tags.

  • C:Compliant

  • NC:Non-compliant

  • NFI:Not filled in

Block tags to use:

  • ##_block:compliant-C## → display in green

  • ##_block:compliant-NC## → display in red

  • ##_block:compliant-NFI## → display in blue

Each pair of tags must be formatted with the desired color.

Result: Only the selected value is displayed, with the corresponding color.

2.2 Hide a row if a field is empty

Objective: hide an entire row if a field has not been filled in (example: no comment).

⚠️ Important

A block tag does NOT allow you to hide a column, it only acts on a row.

Block tag to use: ##_block:comment##.

Hiding rows can sometimes make the table look visually unbalanced.

Here are two possible formatting options.

2.2.1 Layout 1

Fully wrap the comment row with block tags.

Result:

  • Comment filled in → row displayed

  • Comment empty → row hidden

2.2.2 Layout 2 (improved visual effect)

Follow these steps:

  • Hide all borders except the bottom ones.

  • Apply a background color only to the 1st row.

  • Add a row at the end of the table.

  • Insert the tag of one of the fields (e.g.: ##compliant##) written in white to hide its content. This trick creates a regular spacing effect between rows.

Your template should now look like this:

Result:

  • Comment filled in → row visible

  • Comment empty → row hidden

📚 Feel free to check out the tutorial Block Tags and empty fields.

2.3 Display only rows containing a specific element

Objective: display only the rows where the Compliant field contains the value Compliant.

Block tag to use: ##_block:compliant-C##.

2.3.1 Layout 1

Starting from this layout:

Steps:

  1. Enable row splitting

  2. Insert a row between the header and the rows containing the tags

  3. Merge the cells of this new row

  4. Insert the block opening tag into it

  5. Reduce the height of this row to the minimum (fixed 0.1 cm) so that it is invisible on export

  6. Place the closing block tag below the tag in the rightmost cell

  7. Hide all borders except the bottom one, also making sure to handle the borders of the first row.

Your template should now look like this:

Here is the result: only the Compliant rows are displayed.

⚠️ Important

Reducing the row containing the opening block to the minimum (fixed height of 0.1 cm) and hiding its borders makes the repeated empty rows nearly invisible.

Furthermore, any row containing text without a tag will be duplicated as many times as there are entered rows.

2.3.2 Layout 2 (improved visual effect)

Starting from this layout:

Next steps:

  1. Merge the cells of row 1

  2. Hide all borders of row 1

  3. Reduce the height of this row to the minimum (0.1 cm) so that it is invisible on export.

  4. Hide the borders of row 2

  5. Apply a background color to row 2

  6. Keep only the bottom borders on the other rows

Your template should now look like this:

Result: a clean table displaying only the desired rows.

⚠️ Important

Reducing the row containing the opening block to the minimum (fixed height of 0.1 cm) and hiding its borders makes the repeated empty rows nearly invisible.

Furthermore, any line containing text without a tag will be duplicated as many times as there are lines entered.

3. Table properties (Word)

If you select Text wrapping: Around, you must also enable the option:

  • ✅ Move with text, accessible via the Position button.

⚠️ Important

It is not recommended to enable the Allow text overlap option.

💡Tip

To make the template easier to read, you can highlight the block tags.
The highlighting will not be visible in the final export.

Did this answer your question?