Product comparison table

Generate product comparison

Download Template

Download data sample

  • Template type document docx simple
  • Carbone min. v4.24.0+
  • Features bidirectional-loop placeholder
  • Target product comparator insurance technology custom

Objectives

Generate product comparison tables with the following features:

  • Use a horizontal loop to compare a variable number of products or companies
  • Use placeholders to dynamically insert images (e.g., logos)
  • Repeat the table header when a page breaks

Solution

Here’s how you can achieve this using Carbone:

  1. Insert a table and define the elements to be displayed

    • Go to the Insert menu, select Table and create a table (e.g., 3x3)
    • Write the labels for columns. Use [i] and [i+1] to define the horizontal loop

    Example: {d.datas[0].benchmark[i].product} and {d.datas[0].benchmark[i+1].product}

    • To display a logo, insert a temporary image. Use the View alt text menu to define the path of the logo

    Example : {d.datas[0].benchmark[i].logo}

    Note: There is no need to duplicate the entire cell; a single tag with [i+1] is sufficient for each iterated array .

  1. Define the Vertical Repetition

    In the following rows, set up vertical iteration to display the relevant features from your data:

    Example:

    {d.datas[i].features[i].name}  
    {d.datas[i].features[i+1]}
  2. Conditional image

    • Insert a placeholder and use the View Alt Text menu to define the path of the marker to display

      • Use the :ifEQ formatter to check the status of a feature and display a corresponding image based on the result

      Example : {d.datas[i].features[i].cols[i].status:ifEQ(1):show(d.legend.YES)}

      • Multiple conditions can be defined one after another

      Example: {d.datas[i].features[i].cols[i].status:ifEQ(1):show(d.legend.YES):ifEQ(2):show(d.legend.OPTION):ifEQ(3):show(d.legend.NO)}

And there you go!

Tips

  • Prevent rows from breaking across pages

    If you don’t want rows to break across pages, follow these steps:

    1. Highlight the table in the template.
    2. Right-click and go to the Table Properties menu.
    3. Navigate to the Row section.
    4. Deselect the option to allow rows to break across pages.
  • Repeat header rows on subsequent pages

    If you want to repeat the first row when your table spans page 3 and beyond, follow these steps:

    1. Highlight the first row of your second table in the template.
    2. Right-click and go to the Table Properties menu.
    3. Navigate to the Row section.
    4. Select the option "Repeat as header row at the top of each page."

Perfect!

You might also like

Trusted by 600+ paid customers in 40+ countries

Finance
Healthcare
Public
Retail
Industries
Energy
Software
Telecom
1dior.png
22thales.png
23younited.png
2danfoss.png
3cma-cgm.png
3illumina.svg
4KparK.png
6scalingo.png
7defense.png
8bmw.png
8telus.png
bestseller.png
flagship_bioscience.png
insly.png
ninox.png
sodexo.png