首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

[JSP] c:forEach 怎么输出序号

2013-08-01 
[JSP] c:forEach 如何输出序号table width500 border0 cellspacing0 cellpadding0trth

[JSP] c:forEach 如何输出序号

  • <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <th>序号</th> <th>姓名</th> </tr> <c:forEach var="student" items="${ students}" varStatus="status"> <tr> <td>${ status.index + 1}</td> <td>${ student.name}</td> </tr> </c:forEach> </table> ?
  • ??备注:status.index是从0开始的。

  • 热点排行