In NetSuite Advanced HTML/PDF templates, we can use the _index method to get the index of an item in a table.
Here’s an example that demonstrates how to use this method:
<table>
<#list record.item as item>
<tr>
<td>${item.item}</td>
<td>${item.quantity}</td>
<td>${item.price}</td>
<td>${item_index}</td>
</tr>
</#list>
</table>
In this example, record.item is an array of objects representing rows in a table. The _index method is used to get the index of each row in the table. The index is then printed using the ${item_index} notation.