I am trying to display numbers in a table where there are two iterations. but if I use indexVar attribute the numbers are not displaying in sequence. Is there any solution to it? Is there any other function or attribute which I can use?
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
<thead>
<tr class="slds-text-title_caps">
<th class="slds-text-align_right" style="width:3.25rem;">
<div class="slds-truncate" title="Name">Item No</div>
</th>
<th scope="col" class="slds-text-align_center">
<div class="slds-truncate" title="Name">Accounts</div>
</th>
<th scope="col" class="slds-text-align_center">
<div class="slds-truncate" title="Product">Product</div>
</th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.listOfSelectedAccounts}" var="accObj" indexVar ="i">
<aura:iteration items="{!v.listOfSelectedProducts}" var="prodObj" indexVar = "j" >
<tr>
<td scope="row" class="slds-text-align_center" style="width:3.25rem;">
{!i+j+1}
</td>
<td scope="row" class="slds-text-align_center">
<div class="slds-truncate" title="{!accObj.Name}">
<a href="{!'/'+accObj.Id}" target="_blank">{!accObj.Name}</a>
</div>
</td>
<td scope="row" class="slds-text-align_center">
<div class="slds-truncate" title="{!prodObj.Name}">
<a href="{!'/'+prodObj.Id}" target="_blank">{!prodObj.Name}</a>
</div>
</td>
</tr>
</aura:iteration>
</aura:iteration>
</tbody>
</table>