I am using Guide Template Language (GTL) in a HTML email to output data in a table format. The table alignment is off when displaying data from the attributes. I notice that an extra blank column value is added in case of the nested attributes(Color and Size). How can I get rid of these blank values? TIA. Example: HTML Code
{{.datasource attributesItem type=nested maxRows=10 global=false}}
{{.data}}
{ "target" : "line_items.attributes" }
{{/data}}
<td align="left" valign="top" style=" padding-top:0px; padding-bottom:0px;">{{#if attributesItem.name == "Color"}} {{attributesItem.value}} {{/if}}</td>
<td align="left" valign="top" style=" padding-top:0px; padding-bottom:0px; ">{{#if attributesItem.name == "Size"}} {{attributesItem.value}} {{/if}}</td>
{{/datasource}}
Data Context:
[{....,"price":"$30.00","store_pickup_name":"","quantity":{},"brand":"Hurley","attributes":[{"name":"Color","value":"BLACK"},{"name":"Size","value":"MED SIZE"}]},
{....,"price":"$32.47","store_pickup_name":"","quantity":{},"brand":"Nike SB","attributes":[{"name":"Color","value":"RED"},{"name":"Size","value":"LRG SIZE"}]},
{"image":"<img src=\"xxx" alt=\"\" title=\"\"/>","item_upc":"","itemsku":"Box","producttitle":"Gift Box","price":"$3.00","store_pickup_name":"","quantity":1,"brand":"","attributes":[]}]