jsp 頁面上圖片分行輸出小技巧
更新時(shí)間:2009年04月24日 01:33:02 作者:
有時(shí)候需要圖片分行顯示,下面是比較不錯(cuò)的代碼。
<table border="0" cellpadding="2">
<c:forEach items="${pics}" var="pic" varStatus="status">
<c:if test="${((status.index)%3)==0}"><tr></c:if>
<td>
<input class='Input-0-border' name="bk_no" type="radio" value="${pic.piccode}"
<c:if test="${status.index==0}">checked</c:if>
onClick='changeVal(this.value)'/>
<c:if test="${not empty(pic.logoPath)}"><img src="${pic.logoPath}"></c:if>
<c:if test="${empty(pic.logoPath)}"><c:out value="${pic.picname}"/></c:if>
<input type="hidden" name="bk_name" value="<c:out value="${pic.picname}"/>">
</td>
<c:if test="${((status.index+1)%3)==0}"></tr></c:if>
</c:forEach>
</table>
<c:forEach items="${pics}" var="pic" varStatus="status">
<c:if test="${((status.index)%3)==0}"><tr></c:if>
<td>
<input class='Input-0-border' name="bk_no" type="radio" value="${pic.piccode}"
<c:if test="${status.index==0}">checked</c:if>
onClick='changeVal(this.value)'/>
<c:if test="${not empty(pic.logoPath)}"><img src="${pic.logoPath}"></c:if>
<c:if test="${empty(pic.logoPath)}"><c:out value="${pic.picname}"/></c:if>
<input type="hidden" name="bk_name" value="<c:out value="${pic.picname}"/>">
</td>
<c:if test="${((status.index+1)%3)==0}"></tr></c:if>
</c:forEach>
</table>
相關(guān)文章
jsp中獲取狀態(tài)怎么寫(兩種實(shí)現(xiàn)方式)
由于框架是2005年的,jsp中不能存放標(biāo)簽,只能有java代碼來寫了,接下來為大家介紹下兩種實(shí)現(xiàn)獲取狀態(tài)寫法,感興趣的各位可以參考下哈,希望可以幫助到你2013-04-04jsp 顯示springmvc modelmap傳遞的對(duì)象詳細(xì)介紹
這篇文章主要介紹了jsp 顯示springmvc modelmap傳遞的對(duì)象詳細(xì)介紹的相關(guān)資料,具有一定的參考價(jià)值,需要的朋友可以參考下2016-12-12