JSTL for:each 显示表格的问题
遇到这样一个问题 郁闷半天也没找到解决方法 有谁能帮帮我呀?
使用jstl显示一个表 表格第一列放的是记录号,但是记录号是自己写的,不是从数据库里读出来的,问题是怎么显示那一列记录号
<table>
<c:forEach items= "${logList} " var= "logDto " step= "1 ">
<tr height=30 align= "left ">
<td nowrap width= "60 "> 1 </td>
<td nowrap width= "160 "> <my:sf fd= "${logDto.searchTime} "/> </td>
<td nowrap width= "60 "> <my:sf fd= "${logDto.userNo} "/> </td>
<td nowrap width= "60 "> <my:sf fd= "${logDto.clientCode} "/> </td>
<td nowrap width= "160 "> ( <my:substr end= "9 " start= "0 " str= "${logDto.txDateStr} "/> , <my:substr end= "9 " start= "0 " str= "${logDto.txDateEnd} "/> ) </td>
<td nowrap width= "100 "> <my:sf fd= "${logDto.searchDesc} "/> </td>
<td nowrap width= "400 "> <my:sf fd= "${logDto.searCon} "/> </td>
</tr>
</c:forEach>
</table>
<td nowrap width= "60 "> 1 </td> 这一列显示的是记录号
可以使用这个方法建一列
<table border= "1 " align= "center ">
<tr> <td> A </td> <td> B </td> </tr>
<c:forEach var= "i " begin= "0 " end= "5 ">
<tr>
<td> <c:out value= "${i} "/> </td>
</tr>
</c:forEach>
</table>
关键我怎么把这两个for:each放到一起呀
------解决方案--------------------forEach 标签中有一个varStatus的属性,通过它你可以得到序列号
<c:forEach items= "${XXX} " var= "item " varStatus= "tag ">
"${tag.count} "
</c:forEach>
------解决方案-------------------- <table>
<c:forEach items= "${logList} " var= "logDto " step= "1 " varStatus= "status ">
<tr height=30 align= "left ">
<td nowrap width= "60 "> <c:out value= "${status.count} "/> </td>
......
特性 Ge