How to give alternate color based on item field in advanced pdf template?

hi,

I want to give grey and white color alternatively based on club type. Below is advanced pdf template table. Please help!

<table style=”width: 100%; margin-top: 10px;”><!– start items –><#assign currentClubType = ”>
<#list record.item?sort_by(“custcol_cc_clubtype_so”)?reverse as item>
<#if item_index == 0>
<thead>
<tr>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>Qty</span></th>
<th align=”center” colspan=”3″><span style=”font-size:8px;”>BUILD</span></th>
<th align=”center” colspan=”6″><span style=”font-size:8px;”>ITEM</span></th>
<th align=”left” colspan=”5″><span style=”font-size:8px;”>CLUB<br/>TYPE</span></th>
<th align=”left” colspan=”5″><span style=”font-size:8px;”>CLUB<br/>SUB<br/>TYPE</span></th>
<th align=”center” colspan=”10″><span style=”font-size:8px;margin-right:35px;”>HEAD</span></th>
<th align=”center” colspan=”10″><span style=”font-size:8px;margin-right:41px;”>SHAFT</span></th>
<th align=”center” colspan=”10″><span style=”font-size:8px;margin-right:45px;”>GRIP</span></th>
<th align=”center” colspan=”3″><span style=”font-size:8px;”>GRIP<br/>SIZE</span></th>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>${item.custcol_pure@label}</span></th>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>LEN</span></th>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>${item.custcol_bpm_cwo_lie@label}</span></th>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>${item.custcol_bpm_cwo_loft@label}</span></th>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>TIP</span></th>
<th align=”center” colspan=”2″><span style=”font-size:8px;”>SW</span></th>
<th align=”center” colspan=”8″><span style=”font-size:8px;”>${item.custcol5@label}</span></th>
</tr>
</thead>
</#if><tr>
<td align=”center” colspan=”2″ line-height=”150%” style=”height: 25px;”><span style=”font-size:8px;”><b>${record.item.quantity}</b></span></td>
<td align=”center” colspan=”3″ line-height=”150%” style=”height: 25px;”><span style=”font-size:8px;”><b>${item.quantitycommitted}</b></span></td>
<td colspan=”6″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.item}</b></span></td>
<td align=”left” colspan=”5″ line-height=”150%” style=”height: 25px;”>
<span style=”font-size:8px;”><b><#if currentClubType != item.custcol_cc_clubtype_so>${item.custcol_cc_clubtype_so}<#assign currentClubType = item.custcol_cc_clubtype_so></#if></b></span>
</td>
<td align=”left” colspan=”5″ line-height=”150%” style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_cc_club_subtype_so}</b></span></td>
<td align=”left” colspan=”10″ style=”height: 25px;”><span style=”font-size:9px;”><b>${item.custcol_cc_head_description_so}</b></span></td>
<td align=”left” colspan=”10″ style=”height: 25px;”><span style=”font-size:9px;”><b>${item.custcol_cc_shaft_description_so}</b></span></td>
<td align=”left” colspan=”10″ style=”height: 25px;”><span style=”font-size:9px;”><b>${item.custcol_cc_grip_description_so}</b></span></td>
<td align=”center” colspan=”3″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_bpm_cwo_grip_size}</b></span></td>
<td align=”center” colspan=”2″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_pure}</b></span></td>
<td align=”center” colspan=”2″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_bpm_cwo_length}</b></span></td>
<td align=”center” colspan=”2″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_bpm_cwo_lie}</b></span></td>
<td align=”center” colspan=”2″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_bpm_cwo_loft}</b></span></td>
<td align=”center” colspan=”2″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_bpm_cwo_trim}</b></span></td>
<td align=”center” colspan=”2″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol_bpm_cwo_swing}</b></span></td>
<td align=”left” colspan=”8″ style=”height: 25px;”><span style=”font-size:8px;”><b>${item.custcol5}</b></span></td>
</tr>
</#list><!– end items –></table>

Beginner Asked on November 27, 2023 in SuiteBuilder.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor