In Netsuite, the #list loop for the item table will only render as many line items as there are number of of items. For example, if there's two items in a Sales Order, there will be only two line items in the PDF template as rendered by this example code:
<#if record.item?has_content>
<table class="itemtable" style="width: 100%;"><!-- start items -->
<#list record.item as item>
<#if item_index==0>
<thead>
<tr>
<th align="center" colspan="1">${item.quantity@label}</th>
<th align="center" colspan="2">${item.item@label}</th>
<th align="center" colspan="3">${item.description@label}</th>
<th align="center" colspan="1">Unit Price</th>
<th align="center" colspan="1">U/M</th>
<th align="center" colspan="1">${item.amount@label}</th>
</tr>
</thead>
</#if>
<tr> <!--Move itemtable row up slightly to remove white space-->
<td align="right" colspan="1">${item.quantity}</td>
<td colspan="2"><span class="itemname">${item.item}</span></td>
<td colspan="3">${item.description}</td>
<td align="right" colspan="1">${item.rate?string.currency}</td>
<td align="center" colspan="1">${item.units}</td>
<td align="right" colspan="1">${item.amount?string.currency}</td>
</tr>
</#list><!-- end items -->
</table>
</#if>
I have been following this official documentation for adding striping to line items in PDF templates https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N2866065.html
Whereupon you add this to of the items:
<tr style="background-color: ${((item_index % 2)==0)?string('#ffffff', '#ccffcc')};">
I need to extend the #list loop so a few "empty" rows with alternate striping are added to the bottom of the line item table:
Striping of line items with alternate background colors + extended
My use case has different number of line items for each order, otherwise I would just hard code three alternate colored rows myself. Thank you!