比如
<style type="text/css">
.table { margin-left:13px; border:1px solid #f1f1f1; padding:0px; overflow:hidden; clear: both;}
.menu { width:780px;margin:0 auto;}
#menu li{
float: left;
}
</style>
<div class="table">
<ul id="menu">
<logic:iterate id="it" name="indexForm" property="infoContentList" > <li>
<table>
<tr>
<td><img height="100" width="184" src='<bean:write name="it" property="st_img)"/>'/></td>
</tr>
</table>
</li>
</logic:iterate>
</ul>
</div>
<style type="text/css">
.table { margin-left:13px; border:1px solid #f1f1f1; padding:0px; overflow:hidden; clear: both;}
.menu { width:780px;margin:0 auto;}
#menu li{
float: left;
}
</style>
<div class="table">
<ul id="menu">
<logic:iterate id="it" name="indexForm" property="infoContentList" > <li>
<table>
<tr>
<td><img height="100" width="184" src='<bean:write name="it" property="st_img)"/>'/></td>
</tr>
</table>
</li>
</logic:iterate>
</ul>
</div>
<table>
<tr>
<logic:iterate id="it" name="indexForm" property="infoContentList" ><td><img height="100" width="184" src='<bean:write name="it" property="string(st_img)"/>'/></td>
</logic:iterate>
</tr>
</table>
</li>
或是不用li
就是我从后台查询了个
<logic:iterate id="it" name="indexForm" property="infoContentList" >
怎么在jsp页面中怎么实现每四张图片换行显示?
你写下代码不
<logic:iterate id="it" name="indexForm" property="infoContentList" indexId="index">
<table>
<tr>
<logic:iterate id="it" name="indexForm" property="infoContentList" indexId="index">
<td><img height="100" width="184" src='<bean:write name="it" property="st_img"/>'/>
</td>
</logic:iterate>
</tr>
</table>
怎么把${index%4==0?"":""}这里面价进去啊
<tr>
<logic:iterate id="it" name="indexForm" property="infoContentList" indexId="index">
${index%4==0?"":""}<td><img height="100" width="184" src='<bean:write name="it" property="st_img"/>'/>
</td>
</logic:iterate>
</tr>
</table>
怎么把${index%4==0?"":""}这里面加进去啊 “”双引号里怎么写
<table>
<logic:iterate id="it" name="indexForm" property="infoContentList" indexId="index">
<if index%4==0>
<tr>
</if>
<td><img height="100" width="184" src='<bean:write name="it" property="st_img"/>'/>
</td>
<if index%4==0>
</tr>
</if>
</logic:iterate>
<!--打印剩余TD--!>
<if infoContentList.size%4!=0>
<logic:iterate id="it" name="indexForm" property="infoContentList" length="${infoContentList.size-infoContentList.size%4}">
<td> </td>
<tr>
</logic:iterate>
</if>
</table>
<table>
<logic:iterate id="it" name="indexForm" property="infoContentList" indexId="index">
${index%4==0 ? "<tr>" : "" }
<td>
<img height="100" width="184" src='<bean:write name="it" property="st_img"/>'/>
</td>
${(index+1)%4==0 ? "</tr>" : "" }
</logic:iterate>
</table>