{"id":1810,"date":"2022-03-31T10:26:40","date_gmt":"2022-03-31T10:26:40","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=1810"},"modified":"2023-08-21T11:33:10","modified_gmt":"2023-08-21T11:33:10","slug":"tutorial-dynamic-tables","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=1810","title":{"rendered":"Dynamic Tables"},"content":{"rendered":"\n<p>This tutorial explains step-by-step how to create a dynamic table to take advantage of all the dynamics available within Documotor. The tutorial focuses on PowerPoint, but the transformation model is the same for Word. There are some differences in the bindings for Word, details of which can be found at the end of the tutorial. The tutorial contains examples of the template<\/p>\n\n\n\n<div class=\"toc\">\n<h3>Table of contents<\/h3>\n<ol>\n\n<li><a href=\"#DesiredOutput\">Desired Output<\/a><\/li>\n<li><a href=\"#Template\">Template<\/a><\/li>\n<li><a href=\"#AddingContent\">Adding Content<\/a><\/li>\n<li><a href=\"#Transformation\">Transformation<\/a><\/li>\n<li><a href=\"#TryItOut\">Try it Out!<\/a><\/li>\n\n<\/ol>\n<\/div>\n\n\n\n<h2 id=\"Desired\">Desired Output<\/h2>\n\n\n\n<p>We are going to create an output looking like below image:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"578\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-8-1024x578.png\" alt=\"\" class=\"wp-image-1832\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-8-1024x578.png 1024w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-8-300x169.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-8-768x434.png 768w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-8.png 1047w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3>Sample data<\/h3>\n\n\n\n<p>A copy of the sample data used in this tutorial can be downloaded from here:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-a6e5dad1-3611-4ec2-a610-bb986d789f08\" href=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/Table-Data-3.txt\">Table-Data-3<\/a><a href=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/Table-Data-3.txt\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-a6e5dad1-3611-4ec2-a610-bb986d789f08\">Download<\/a><\/div>\n\n\n\n<h3>Overview<\/h3>\n\n\n\n<p>There are X steps to creating the template:<\/p>\n\n\n\n<ol><li>Define the table. This is done within PowerPoint itself. All formatting should be applied here. It is always best to start with a finished design, so it is clear what the desired output should be.<\/li><li>Add and format the content which should be presented within the table.<\/li><li>Create the Transformation required to populate the table.<\/li><li>Apply the relevant binding to ensure that the transformed data is applied to the table<\/li><\/ol>\n\n\n\n<h3>Dynamic table model<\/h3>\n\n\n\n<p>A full specification of the dynamic table model can be found <a href=\"https:\/\/info.documotor.com\/?page_id=1476#section_5\" data-type=\"URL\" data-id=\"https:\/\/info.documotor.com\/?page_id=1476#section_5\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>. This tutorial will not refer to each possible option available within the model, but the sample data and slides found here can be uploaded to Documotor for you to experiment with. The options in the model are all available to be applied to the data and the template here. <\/p>\n\n\n\n<h2 id=\"Template\">Template<\/h2>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-cb9322d4-04c5-4c1f-b33b-f4ea07180216\" href=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/Dynamic-Table-template.pptx\">We can achieve the desired output using the following template, a copy of which can be downloaded from here for convenience.<\/a><a href=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/Dynamic-Table-template.pptx\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-cb9322d4-04c5-4c1f-b33b-f4ea07180216\">Download<\/a><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"578\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-10-1024x578.png\" alt=\"\" class=\"wp-image-1835\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-10-1024x578.png 1024w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-10-300x169.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-10-768x433.png 768w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-10.png 1046w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Note that this slide contains only 2 rows. It is possible to populate as many rows as you need using just one row.<\/p>\n\n\n\n<h3 id=\"AddingContent\">Adding Content<\/h3>\n\n\n\n<p>We need to create fields for all possible different content types within that row and format them as appropriate. NOTE: for each different type of content we must create a different field. We then use our transformations to define the data we need per row and then pass the data to the correct field. <\/p>\n\n\n\n<p>For more information on creating fields in PowerPoint read the article on <a href=\"https:\/\/info.documotor.com\/?page_id=4433\" data-type=\"URL\" data-id=\"https:\/\/info.documotor.com\/?page_id=4433\" target=\"_blank\" rel=\"noreferrer noopener\">Fields in PowerPoint<\/a>. Note dynamic tables differ from static tables in this regard as we do not place a field for each individual data point.<\/p>\n\n\n\n<p>Let&#8217;s take a look at the attached table in depth.<\/p>\n\n\n\n<p><strong>Row 1:<\/strong> <\/p>\n\n\n\n<ul><li>Contains no fields in any cell. <\/li><li>All cells are formatted identically. <\/li><li>Dynamic tables work by repeating ONLY the last row so this row will not be repeated.<\/li><\/ul>\n\n\n\n<p><strong>Row 2:<\/strong><\/p>\n\n\n\n<ul><li>All cells contain unique <a href=\"https:\/\/info.documotor.com\/?page_id=4433\" data-type=\"URL\" data-id=\"https:\/\/info.documotor.com\/?page_id=4433\" target=\"_blank\" rel=\"noreferrer noopener\">fields references<\/a>.<\/li><li>Cell one contains two different fields each formatted differently, ProductHeader and Date.<\/li><li>This row will be repeated for each data point we need to display.<\/li><\/ul>\n\n\n\n<h3>Design Considerations<\/h3>\n\n\n\n<p><strong>Table Length<\/strong> <\/p>\n\n\n\n<p>Native PowerPoint does not support splitting tables automatically across multiple slides. When building tables that may contain lots of data it is worth considering this. However, it is possible to <a href=\"https:\/\/info.documotor.com\/?page_id=648\" data-type=\"URL\" data-id=\"https:\/\/info.documotor.com\/?page_id=648\" target=\"_blank\" rel=\"noreferrer noopener\">repeat slides<\/a> so that we can present the data across a number of different copies of the same slide. <\/p>\n\n\n\n<p><strong>Table and Column<\/strong> <strong>width<\/strong><\/p>\n\n\n\n<p>Particularly for Word, it is worth mentioning that in the Table Properties (accessible by right-clicking on the table) the &#8220;Preferred width&#8221; should be set to 100%, and the columns&#8217; &#8220;Preferred width&#8221; should be measured in centimeters\/pixels. Setting the columns&#8217; &#8220;Preferred width&#8221; to be measured in percentage, might affect the final table layout in the generated document.<\/p>\n\n\n\n<p><strong>Field Variations<\/strong><\/p>\n\n\n\n<p>It is possible to include as many variations of fields as possible within a single cell. And any characters not within the field will also be repeated per row, so it is possible to add specific non-dynamic text. <\/p>\n\n\n\n<p>However, this also applies to non-printing characters such as carriage returns. In our example, we have placed both fields on the same line. If instead, we had separated the two fields with a carriage return, each new row would begin with a carriage return and so the spacing would be incorrect.<\/p>\n\n\n\n<h2 id=\"Transformation\">Transformation<\/h2>\n\n\n\n<p>The complete transformation used in this tutorial can be seen below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n&nbsp;&nbsp;ProductsTable:&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;Options:&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"KeepTotalWidth\":&nbsp;`true`\n&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;\"Headers\":&nbsp;@.DataToShow.[\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;Date\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;Region\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;SalesRep\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;Product\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;Units\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;PricePerUnit\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"Visible\":&nbsp;TotalCost\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;],\n&nbsp;&nbsp;&nbsp;&nbsp;Rows:&nbsp;<strong>group_adjacent<\/strong>(<strong>sort_by<\/strong>(SalesData,&nbsp;&amp;Product),&amp;Product)[*].[\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;placeholder:&nbsp;'placeholder'\n&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProductHeader:&nbsp;@[0].Product\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*].{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date:&nbsp;Date,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Region:&nbsp;Region,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SalesRep:&nbsp;SalesRep,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Product:&nbsp;Product,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Units:&nbsp;Units,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PricePerUnit:&nbsp;<strong>format<\/strong>(<strong>to_number<\/strong>(PricePerUnit,&nbsp;'en-US'),&nbsp;'c',&nbsp;'en-US'),&nbsp;\/\/Convert&nbsp;to&nbsp;dollarsTotalCost\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TotalCost:&nbsp;<strong>format<\/strong>(<strong>to_number<\/strong>(TotalCost,&nbsp;'en-US'),&nbsp;'c',&nbsp;'en-US')&nbsp;\/\/Convert&nbsp;to&nbsp;dollarsTotalCost\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;][][]\n&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<h3>Transformation Explained<\/h3>\n\n\n\n<p>The object that holds the entire table data is called <code>ProductsTable<\/code>. Within this we have:<\/p>\n\n\n\n<p><code>Options <\/code>&#8211; This object is optional. In this case, <code>KeepTotalWidth<\/code> is simply set to be true. This means that if columns are hidden as part of our transformation, the table will automatically resize to fit. Note that this does not refer to the sample data at all, but of course it can do.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">Options: {\n  \"KeepTotalWidth\": `true`\n}<\/code><\/pre>\n\n\n\n<p><code>Headers <\/code>&#8211; Here we are referring to the <code>DataToShow<\/code> node in our sample data and creating a single object for each element in the node to pass each relevant data point to a value called visible. This is where we control the visibility of each column. If the result is true, the column will be shown, if the result is false it will be hidden.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">\"Headers\": @.DataToShow.[\n  {\n    \"Visible\": Date\n  },\n  {\n    \"Visible\": Region\n  },\n  .\n  .\n  .\n  {\n    \"Visible\": TotalCost\n  }\n]<\/code><\/pre>\n\n\n\n<p><code>Rows <\/code>&#8211; Here we define the data to be presented in each row. The transformation creates an array where each object refers to a single row.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"524\" height=\"463\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-13.png\" alt=\"\" class=\"wp-image-1856\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-13.png 524w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-13-300x265.png 300w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s take a look at this in detail.<\/p>\n\n\n\n<p>Firstly, we are sorting the data as we need to in <strong>point 1<\/strong>. The sample data is not sorted in any particular order. So we apply a simple transformation to it using <code>group_adjacent(sort_by(SalesData, &amp;Product),&amp;Product)[*]<\/code>. In short, <code>sort-by<\/code> sorts all of the data into a single array by the Product data node in each object. <code>group_adjacent<\/code> then splits this single array into separate arrays for each product, 3 in this case. <code><strong>[*]<\/strong><\/code> then ensures that rest of the transformation is applied to each of these arrays in turn.<\/p>\n\n\n\n<p>For more information on the <code>sort_by<\/code> function see <a href=\"https:\/\/jmespath.org\/specification.html#sort-by\" target=\"_blank\" rel=\"noreferrer noopener\">here.<\/a><\/p>\n\n\n\n<p>For more information on the <code>group_adjacent<\/code> function see <a href=\"https:\/\/info.documotor.com\/?page_id=3378\" data-type=\"page\" data-id=\"3378\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>In <strong>point 2<\/strong>, we define our first row object. Note that in this case, we are not transforming any sample data at all. When we bind the table to the data, even though the first row is not repeated, it still needs to be considered when defining the data, so we simply create a placeholder object here to create a row.<\/p>\n\n\n\n<p>In <strong>point 3<\/strong>, we define our header row. Comparing this to the template, you will notice that the sample data is transformed into a new <code>ProductHeader<\/code> data point which is defined as a field within the template. The template will use this data in the row and because none of the other fields exist in the output data, they will not be populated when the presentation is generated.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"941\" height=\"62\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-12.png\" alt=\"\" class=\"wp-image-1855\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-12.png 941w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-12-300x20.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-12-768x51.png 768w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/figure>\n\n\n\n<p>In <strong>point 4<\/strong>, we define our remaining rows. The use of <code>[*]<\/code> indicates that for every object in our data, we will transform this to become a new object with each data point referenced within that object. Note that this entire point could be achieved with a simpler transformation, i.e., <code>[*]<\/code> which would simply pass all of the data unformatted from the sample data. However, we more often than not want to apply other transformations to the data, as in this example where we format the <code>PricePerUnit<\/code> and TotalCost data points in US Dollars. For information on how to achieve this, see <a href=\"https:\/\/info.documotor.com\/?page_id=3753\" data-type=\"page\" data-id=\"3753\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>In <strong>point 5<\/strong>, we simply flatten the data we have transformed into a single array. Information on flattening projections can be found <a href=\"https:\/\/jmespath.org\/tutorial.html#flatten-projections\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h4>Custom Functions<\/h4>\n\n\n\n<p>The transformation required to create dynamic tables can often be quite comprehensive. It is often a good idea to consider using custom functions to help with this. A guide on creating custom functions can be found <a href=\"https:\/\/info.documotor.com\/?page_id=1562\" data-type=\"URL\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h3>Table Binding<\/h3>\n\n\n\n<p>The binding for the table is:<\/p>\n\n\n\n<p><code>&lt;&lt;DynamicTable:[AltText]<em>$tableData<\/em>&gt;&gt;<\/code><\/p>\n\n\n\n<p><code>[AltText]<\/code> refers to a string. This text will appear as the alt text of the table after it has been created. In our example, this is simply DynamicTableExample.<\/p>\n\n\n\n<p><code>tableData<\/code> refers to the data point in the output data that contains all the relevant information for the table.<\/p>\n\n\n\n<p>To add the binding, simply select the table, open the <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/add-alternative-text-to-a-shape-picture-chart-smartart-graphic-or-other-object-44989b2a-903c-4d9a-b742-6a75b451c669\" target=\"_blank\" rel=\"noreferrer noopener\">alt text pane<\/a> and add.<\/p>\n\n\n\n<h2 id=\"TryItOut\">Try it out!<\/h2>\n\n\n\n<p>Now that we created our dynamic table let&#8217;s look at what can be improved or amended about it. Below are just a few examples but feel free to experiment with different options. The specific transformations required to produce these outcomes have not been included in this tutorial but everything you need to create them can be found here.<\/p>\n\n\n\n<p><strong>Hiding the total cost column<\/strong><\/p>\n\n\n\n<p>By changing the sample <code>DataToShow.TotalCost<\/code> value in the sample data we are able to hide the Total cost column so that our output now looks like:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"696\" height=\"390\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-14.png\" alt=\"\" class=\"wp-image-1858\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-14.png 696w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-14-300x168.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/figure>\n\n\n\n<p><strong>Highlighting High and low performers with cell shading<\/strong><\/p>\n\n\n\n<p>In this example we have:<\/p>\n\n\n\n<ol><li>Added a <code>cells <\/code>array to each row as per the dynamic table <a href=\"https:\/\/info.documotor.com\/?page_id=1476#section_5\" target=\"_blank\" rel=\"noreferrer noopener\">model<\/a>.<\/li><li>Converted the <code>units<\/code> data point to a <a href=\"https:\/\/info.documotor.com\/?page_id=3952\" data-type=\"page\" data-id=\"3952\" target=\"_blank\" rel=\"noreferrer noopener\">number format<\/a> within the 4th object of the array (corresponding to the 4th column in the template)<\/li><li>Used an <a href=\"https:\/\/info.documotor.com\/?page_id=3503\" data-type=\"page\" data-id=\"3503\" target=\"_blank\" rel=\"noreferrer noopener\">if statement<\/a> to calculate if the value is greater than 90 and if so applied a <code>BackgroundColor<\/code> of green.<\/li><li>Used another if statement to calculate if the value is less than 60 and applied a <code>BackgroundColor<\/code> of red. <\/li><\/ol>\n\n\n\n<p>The result is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"696\" height=\"390\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-16.png\" alt=\"\" class=\"wp-image-1862\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-16.png 696w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-16-300x168.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/figure>\n\n\n\n<p><strong>Merging and Aligning cells<\/strong><\/p>\n\n\n\n<p>In this example we have:<\/p>\n\n\n\n<ol><li>Used the <code>__mergeCells <\/code>method on the header rows to merge all cells in that row into a single cell<\/li><li>Used <code>__alignment&nbsp;<\/code>method on the header row to align the text to the center.<\/li><li>Set a background colour for the header rows.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"696\" height=\"390\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-17.png\" alt=\"\" class=\"wp-image-1863\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-17.png 696w, https:\/\/info.documotor.com\/wp-content\/uploads\/2022\/03\/image-17-300x168.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/figure>\n\n\n\n<h2>Dynamic Tables in Word<\/h2>\n\n\n\n<p>As mentioned in the introduction, creating a dynamic table in Word is very similar to PowerPoint. The key differences are:<\/p>\n\n\n\n<ul><li>Bindings are applied via content controls: <code>{\"BindingType\": \"DynamicTable\", \"BindingKey\": \"tableData\" }<\/code><\/li><li>The same cell functionality is not currently supported.<\/li><\/ul>\n\n\n\n<p>More information on the dynamic table model for Word can be found <a href=\"https:\/\/info.documotor.com\/?page_id=346#section_10\" data-type=\"URL\" data-id=\"https:\/\/info.documotor.com\/?page_id=346#section_10\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<div class=\"wp-container-1 wp-block-buttons\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/info.documotor.com\/?page_id=2426\">Tutorial \u2013 Repeating Slides<\/a><\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial explains step-by-step how to create a dynamic table to take advantage of all the dynamics available within Documotor. The tutorial focuses on PowerPoint, but the transformation model is the same for Word. There are some differences in the bindings for Word, details of which can be found at the end of the tutorial. [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":2549,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1810"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1810"}],"version-history":[{"count":63,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1810\/revisions"}],"predecessor-version":[{"id":5641,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1810\/revisions\/5641"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/2549"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}