比如
<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>

解决方案 »

  1.   

    <li>
    <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页面中怎么实现每四张图片换行显示?
      

  2.   

    当前下标 index % 4 == 0 就换行,然后判断集合的size % 4 != 0 && size ==index 也换行
      

  3.   

    index % 4 == 0 我用的是这个   但是<td><tr>  不知道怎么写进去 
      你写下代码不
    <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?"":""}这里面价进去啊
      

  4.   

    <table>
    <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?"":""}这里面加进去啊  “”双引号里怎么写
      

  5.   

    Struts 1的标签忘了
    <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>&nbsp;</td>
    <tr>
    </logic:iterate>
    </if>
    </table>
      

  6.   

    解决了哈   就这样就可以了
    <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>