Perhaps the easiest method for creating a repeating table in your document template is to utilize the drag and drop functionality provided by the Data Source Pane. Use the following steps to create a repeating table using the drag and drop method. In this example, we'll demonstrate using a simple invoice to list, in table format, information for each product that was purchased in the billing period.
1. Enable the Data Source Pane by selecting Data Source from the Home Tab in the Ribbon.
2. You will need to consider which element in your data source is the item that you want your table row to repeat for. In our example, we have a repeating element called "Product" in our data source. This repeating element is exactly what we want our table row to repeat for: repeat the table row displaying information about every product purchased.
Figure 1: The Product element repeats in the data source and will be used to create the repeating table.
3. Once you have located the element that you wish your table row to repeat for, select the element in the Data Source Pane and, holding down the mouse button, drag and drop the element into the Design Surface.
4. Upon mouse release in the Design Surface, you will be presented with a contextual menu. Here you must select Table.
Figure 2: Table is selected from the contextual menu when releasing the mouse button.
5. The Publisher will automatically create a repeating table for you including the addition of a table header row. You should notice that every attribute or element present in the selected repeating element is now present as a column in the table and the default table formatting is applied.
Figure 3: A repeating table is automatically created.
6. You should also notice that by placing your cursor anywhere within the repeating table row, the row will be highlighted in green and an indication will be visually given to show what element in your data source the table row repeats for.
Figure 4: Information on the repeating table row is displayed when placing cursor within.
7. At this point, you will want to make modifications to your table including adding or deleting columns, modifying the column headers, adding formatting and more. You can learn more about such operations in the Working With Tables section of the documentation. In our example, we'll simply delete the "Description" column and apply some quick formatting in the Design Tab located in the Ribbon.
Figure 5: The repeating table is modified for output purposes.
8. Next, you should preview your output to ensure that your repeating table is configured properly. You can see in Figure 6 that for every "Product" element, the table row repeats displaying information relative to each product.
Figure 6: The content in the output reveals the repeating table is behaving as expected.