You need to sign in to do that
Don't have an account?
Adding Table Row Count or Row Numbers
I have a visualforce page that shows a related list and I was wondering if it was possible to add either a table row count at the bottom of a table or add row numbers? I have tried a few different sets of code that I had found but nothing is working. Any help would be great! Thanks! Below is the e table:
<p><u>Related Claims</u></p>
<table id="claims" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.name}</td>
</tr>
</apex:repeat>
</table>
Hi, check if this help:
All Answers
You may be able to do this via javascript, by rendering a script snippet that increments the counter or iterating the table elements and counting them. I tend to use a wrapper class to encapsulate the sobject and the additional information. That way I can set the counters up server side and simply render the details as I would with any other list.
Hi Marni,
You can use <apex:variable> to give numbers to each of row.
Hi, check if this help:
That worked! Thank you so much!