Articles on: Tutorials

How to keep merged rows inside a table loop?

How to keep merged rows inside a table loop?


Carbone can't keep a merged rows when it is mixed with a loop of rows, the column will be transformed as a row on the generated report. This article is about creating a document that contains a table with merged columns mixed with loop of rows, such as:


Table example with merge rows


Solution


Create a table inside a table, such as:


Table of 2x2 inside a table of 2x1


When this table wrapping is created, it may also add some space between table (margin/padding). Follow the below instruction to remove it.


Removing extra space for MS Word


It is possible to remove the margin space between the inner table and the cell, follow these instructions for MS Word:


  1. Right-click on the table > "properties"
  2. Select the tab "Table"
  3. Click on the "Options..." button
  4. Set the left and right margin at zero
  5. Save


Ms Word - Remove cell margin


Removing extra space for Libre Office


Instructions for Libre Office:


  1. Right click on the table > "table properties"
  2. Select the tab "Borders"
  3. Set the padding at zero
  4. Save


Libre Office - Update table padding


Finally generate the report with Carbone and merged rows will render as expected, voilà 🎉

Updated on: 09/09/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!