How to Create Nested Tables in Word Templates
This document outlines how to create a "nested table," in other words, one table built inside of another one. This is particularly useful when you want a multi-row / multi-column detail region to repeat.
While the screen shots below display traditional merge fields, the process of creating the Word tables is the same whether you are running Conga Composer Release 7 or Release 8 (only the style of merge fields may differ between releases).
This documentation explains how to nest Word tables but does not include guidance on nesting detail regions when using nested queries in Conga Composer Release 8.
The objective of this exercise is to create a table like the one shown below. The example below is for a related list of Contacts, but the concept is applicable to any list.
In this case, the desired layout for each record is a two-row, four-column table (the “repeating table”) that will be repeated for each item retrieved by a Salesforce report (or SOQL query) configured for use with a Conga Composer® solution:
A containing table of three columns and two rows is used to provide a mechanism for controlling presentation of the repeating table:
This approach is superior to others in that the repeating table can be prevented from “breaking” across pages with the Word option to disallow the breaking of a row across pages (
"Allow row to break across pages"). A second benefit is the ability to repeat the header row of the table at the top of a subsequent page should the table need to flow across multiple pages.The steps required to implement this are as follows:
We may want to go back and adjust the height of the second row in the containing table so there is not so much white space between each of the repeated tables. We may also want to turn off the border below the heading of "Contacts" if we don't like the look of that border separating each of the repeated tables. Testing your solution is important as it will reveal these sorts of desired formatting tweaks.
Examples of Nested Tables in Conga Word Templates
Create the black table first, be sure to edit Table Properties so that table will not automatically resize to fit contents
Insert the TableStart and TableEnd fields into the “wings” of the bottom row of the black table. These “wings” can be skinnier in width so the middle column of the bottom row better matches the width of the top row. The TableStart and Table End will get stretched out vertically, which will force the row to be taller – not to worry, that will go away in the output file as the TableStart and TableEnd disappear.