How to Increment Sr No on Visual force Page
<apex:page>
<apex:form >
<table style="width:auto;margin-top:10px;" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td style="background-color:lightblue;font-weight:bold;vertical-align:bottom;text-align:center;width:34px;"> Sr.No </td>
<td style="background-color:lightblue;font-weight:bold;vertical-align:bottom;text-align:center;width:34px;"> Name</td>
</tr>
</table>
<apex:variable value="{!0}" var="Count"/>
<table id="tblInfo" style="width:auto;border-top: 0;" border="1" cellspacing="0" cellpadding="0" >
<tbody>
<apex:repeat value="{!lstWrapper}" var="wrap">
<apex:variable value="{!Count + 1}" var="Count"/>
<tr>
<td style="vertical-align:bottom;text-align:center;width:34px;"> {!Count}</td>
<td style="vertical-align:bottom;text-align:center;width:34px;"> {!Name}</td>
</tr>
</apex:repeat>
</tbody>
</table>
</apex:form>
</apex:page>
<apex:form >
<table style="width:auto;margin-top:10px;" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td style="background-color:lightblue;font-weight:bold;vertical-align:bottom;text-align:center;width:34px;"> Sr.No </td>
<td style="background-color:lightblue;font-weight:bold;vertical-align:bottom;text-align:center;width:34px;"> Name</td>
</tr>
</table>
<apex:variable value="{!0}" var="Count"/>
<table id="tblInfo" style="width:auto;border-top: 0;" border="1" cellspacing="0" cellpadding="0" >
<tbody>
<apex:repeat value="{!lstWrapper}" var="wrap">
<apex:variable value="{!Count + 1}" var="Count"/>
<tr>
<td style="vertical-align:bottom;text-align:center;width:34px;"> {!Count}</td>
<td style="vertical-align:bottom;text-align:center;width:34px;"> {!Name}</td>
</tr>
</apex:repeat>
</tbody>
</table>
</apex:form>
</apex:page>
Comments
Post a Comment