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學(xué)習(xí)經(jīng)驗(yàn)小結(jié)分享
本文介紹的是JSP的學(xué)習(xí)經(jīng)驗(yàn)總結(jié),希望對你有幫助,一起來看。2015-09-09
jsp提交到Servlet報(bào)404錯(cuò)誤問題解決(webroot下子目錄)
第一次用jsp寫東西,在webroot子文件夾下寫jsp,當(dāng)提交到Servlet時(shí)報(bào)404錯(cuò)誤,下面是具體的解決方法,有類似問題的朋友可以參考下哈2013-06-06
J2ME/J2EE實(shí)現(xiàn)用戶登錄交互 實(shí)現(xiàn)代碼
用手機(jī)客戶端進(jìn)行登錄服務(wù)器,然后返回消息進(jìn)行交互.2009-07-07
JSP中內(nèi)建exception對象時(shí)出現(xiàn)500錯(cuò)誤的解決方法
這篇文章主要介紹了JSP中內(nèi)建exception對象時(shí)出現(xiàn)500錯(cuò)誤的解決方法,以一個(gè)簡單實(shí)例形式分析了exception對象出現(xiàn)500錯(cuò)誤的解決方法,涉及瀏覽器及error文件的設(shè)置技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-11-11

