日期:2014-05-16  浏览次数:20363 次

jsp中遍历集合时自动换行的问题:代码如下,但是页面显示结果很乱,现在想要要横着排,请问怎么修改
<fieldset style="width: 100%;">
        <legend>
          <omcTag:text name="label.repeater.performance.paramName" />
          <input type="checkbox" id="selectAllParam" <s:if test="%{#pollLogParams.size() == params.size() }">checked="checked"</s:if>/><label><omcTag:text name="label.operate.selectAll"/></label>
        </legend>
        <table>[img=http://zhidao.baidu.com/question/521606993?quesup2&oldq=1][/img]
          <tr>
            <s:iterator var="var" value="pollLogParams" status="status">
              <td>
              <span style="display:inline-block">
              <input type="checkbox" name="params" value="${var.id }" id="param${status.count }" <s:if test="%{params.contains(#var.id + '') }">checked="checked"</s:if> /><label for="param${status.count }">${var.label }</label>
              </span>
              </td>
            </s:iterator>
          </tr>
        </table>
      </fieldset>
jsp iterator table

------解决方案--------------------
看图应该是给 td 或 span 指定了宽度
如果要横排,把每一行放在一个 tr 里就行了