Converts any CSV text to a HTML table.
This action is useful when you read CSV data from a database lookup and you need to easily convert the content to readable HTML. The HTML can then be included on outgoing emails or used as a return value for webform Message Sources.
In the CSV editor, enter or paste the CSV text, or use a %variable% replacement for CSV data created from an earlier action.
The Preview window will show a preview of the HTML created. The CSV will be converted to a HTML table.
You can optionally add a Title which will appear above the table.
If the Return Full Page option is enabled then the returned HTML will include html, body, head tags. Otherwise only the table html will be returned. This is useful if you are embedding the table into an existing HTML document.
If the Use Default Styles option is enabled then the table will have a default style sheet applied.
You can also optionally add any custom CSS (eg: body {background-color: lightblue;}).
Enable the Add Bootstrap Classes to add Bootstrap class names to the table. You can then enable other Bootstrap classes: Bordered, Hoverable, Responsive, Small & Striped Rows. You can also select the Bootstrap Color.
Select the ThinkAutomation variable to receive the HTML from the Assign Html To list.
Example:
The following CSV:
year,color,country,food 2001,red,France,cheese 2005,blue,"United States",hamburger 2008,green,Italy,pasta
Would be converted to:
<table> <col style="width:15.38%" /> <col style="width:17.95%" /> <col style="width:38.46%" /> <col style="width:28.21%" /> <thead> <tr> <th style="text-align: right;">Year</th> <th>Color</th> <th>Country</th> <th>Food</th> </tr> </thead> <tbody> <tr> <td style="text-align: right;">2001</td> <td>red</td> <td>France</td> <td>cheese</td> </tr> <tr> <td style="text-align: right;">2005</td> <td>blue</td> <td>United States</td> <td>hamburger</td> </tr> <tr> <td style="text-align: right;">2008</td> <td>green</td> <td>Italy</td> <td>pasta</td> </tr> </tbody> </table>