Sunday, March 30, 2014

Row numbering use status in iterator List

1st:
 <s:iterator value="teacherTypeList" status="status">
<tr>
  <td width="2%"><s:property value='#status.count'/></td>
  <td width="2%"><s:property value='tech_general_info_id'/></td>
  <td width="4%" style="text-align:left;"> <s:property value='tech_name'/></td>
  <td width="15%">&nbsp;</td>
  <td width="2%">&nbsp;</td>
  <td width="4%">&nbsp;</td>
  <td >&nbsp;</td>
  <td width="15%">
  <span><a href="adminTcEditLadmin.do">Edit</a></span>
  <span><a href="#">Delete</a></span>
  </td>
  <td ><a href="#" style="font-family:Arial; font-size:12px; font-weight:bold; color:#000;">DoEdit</a></td>
   <td ><a href="#" style="font-family:Arial; font-size:12px; font-weight:bold; color:#000;">DoDelete</a></td>
</tr>
 </s:iterator>

N.B: Common part  is bold. out put is :
Row 1
Row 2  .......etc



<div class="panel-body" style=" float:l; width:100%; height:auto;background: #FFF;padding:0px; text-align:center;">
<table width="100%" border="1px solid #CCC;">
<tr style="font-family:Arial; font-size:12px; font-weight:bold; background:#CCC;">
  <td width="2%">SL.</td>
  <td width="5%">Id</td>
  <td width="15%">Teacher Name</td>
  <td width="10%">Designation</td>
  <td width="10%">EIIN</td>
  <td width="15%">Institute Name</td>
  <td width="7%">First Join</td>
  <td width="10%">Actions</td>
  <td width="10%">DoEdit</td>
  <td width="10%">DoDelete</td>
</tr>
 <s:iterator value="teacherTypeList" status="status">
<tr>
  <td width="2%"><s:property value='#status.count'/></td>
  <td width="2%"><s:property value='tech_general_info_id'/></td>
  <td width="4%" style="text-align:left;"> <s:property value='tech_name'/></td>
  <td width="15%">&nbsp;</td>
  <td width="2%">&nbsp;</td>
  <td width="4%">&nbsp;</td>
  <td >&nbsp;</td>
  <td width="15%">
  <span><a href="adminTcEditLadmin.do">Edit</a></span>
  <span><a href="#">Delete</a></span>
  </td>
  <td ><a href="#" style="font-family:Arial; font-size:12px; font-weight:bold; color:#000;">DoEdit</a></td>
   <td ><a href="#" style="font-family:Arial; font-size:12px; font-weight:bold; color:#000;">DoDelete</a></td>
</tr>
 </s:iterator>
</table>
</div>




Example Link:
http://stackoverflow.com/questions/22061414/create-dynamic-row-in-jsp-using-for-loop

No comments:

Post a Comment