<c:forEach items="${datas}" var="item">
  <c:forEach items="${item}" var="entry">
  
     ${entry.value}<br/>
  
  </c:forEach>
 
</c:forEach>
怎么做一个三列的表格行是未知的
主要是告诉我这个实现的语法  我对这个有点陌生。要代码也要解释
先谢谢了

解决方案 »

  1.   


    <table>
    <c:forEach items="${datas}" var="item"> 
      <c:forEach items="${item}" var="entry"> 
        <tr><td>${entry.value1}</td><td>${entry.value2}</td><td>${entry.value3}</td></tr> 
      </c:forEach> </c:forEach> </table>
      

  2.   

    应该是很有点问题的 jstl我也很陌生
      

  3.   

    <c:forEach items="${item}" var="entry"  varStatus="status"> 
      
       <c:if test='${status.count%3 eq 0}'>//对3求余,status.count表示当前 状态索引
        <tr>
       </c:if>
        <td>${entry.value} <br/> </td>
       <c:if test='${status.count%3 eq 2}'>//对3求余
        </tr>
       </c:if>  
    </c:forEach>
      

  4.   

    套什么套呀直接使用List<Entry>
    放到request范围中,直接遍历就行了。
    <table>
    <tr><th>xxx</th><th>xxx</th></tr>
    <c:forEach items="${存放在范围中的名字}" var="item">
    <tr><td>${item.xxx}</td><td>${item.xxx}</td></tr>
    </c:forEach> 
    </table>
      

  5.   

    <c:forEach items="${datas}" var="item"> 
      datas是个什么东西,是不是map对象
      

  6.   

    你把map,还有map里什么对象说一下,我帮你写好了
      

  7.   

    还是说清楚点,不说清楚 叫别人怎么帮你啊!是不是list里面的元素是map啊
      

  8.   

    datas是一个list没个list有三个map
    map无限制 这么说清楚了吗?
    我这个datas = list<map<key values>>
      

  9.   

    <c:forEach items="${datas}" var="item"> 
    <c:forEach items="${item}" var="entry"  varStatus="status"> 
      <c:if test='${status.count%3 eq 0}'>//对3求余,status.count表示当前 状态索引 
        <tr> 
      </c:if> 
        <td>${entry.value} <br/> </td> 
      <c:if test='${status.count%3 eq 2}'>//对3求余 
        </tr> 
      </c:if>  
    </c:forEach>
    </c:forEach>
      

  10.   

    有错</tr>那里说没有开始标签
    估计是循环错误
    能不能给我讲讲if里面的test=?这是什么
    status.count又是什么?
      

  11.   

    我跟你说,运行是没有问题的,不信你试试看先,我知道
    <c:if test='${status.count%3 eq 2}'>//对3求余 
         </tr> 
       </c:if> 
    会提示
     </tr> 
    没有起始标签
      

  12.   

    <c:forEach items="${item}" var="entry"  varStatus="status"> 
       <c:if test='${status.count%3 eq 0}'>这个有点像
    for(int i=0;i<n;i++)
    {
       if(i%3==0)
       {   }}
      

  13.   

    问题是mye打了x的话根本就不可能显示啊
      

  14.   

    只有 <br/>有效果其他都没
    是可以运行哦
      

  15.   

    那${entry.value}  不会没有值的吧,你能保证list及list  中的map有值吗
      

  16.   

    只有 <br/>有效果其他都没
    是可以运行哦
      

  17.   

    <table>
    <c:forEach items="${datas}" var="item"> 
      <c:forEach items="${item}" var="entry"> 
        <tr><td>${entry.value1}</td><td>${entry.value2}</td><td>${entry.value3}</td></tr> 
      </c:forEach> </c:forEach> </table>
      

  18.   

    </table>
    <c:forEach items="${datas}" var="item"> 
    <c:forEach items="${item}" var="entry"  varStatus="status"> 
      <c:if test='${status.count%3 eq 0}'>//对3求余,status.count表示当前 状态索引 
        <tr> 
      </c:if> 
        <td>${entry.value} <br/> </td> 
      <c:if test='${status.count%3 eq 2}'>//对3求余 
        </tr> 
      </c:if>  
    </c:forEach> 
    </c:forEach>
    </table>你不会连table也没有加上吧,没有加上的话就没有表格效果了
      

  19.   

    <table>
    <c:forEach items="${datas}" var="item"> 
    <tr>
      <c:forEach begin="1" step="1" end="3"> 
      <td>
        ${entry.value} <br/> 
      </td>
      </c:forEach> 
    </tr>
    </c:forEach> 
    </table>
    这两个应该可以的
      

  20.   

    </table>
    <c:forEach items="${datas}" var="item">
    <c:forEach items="${item}" var="entry"  varStatus="status">
      <c:if test='${status.index%3 eq 0}'>//对3求余,status.count表示当前 状态索引
        <tr>
      </c:if>
        <td>${entry.value} <br/> </td>
      <c:if test='${status.index%3 eq 2}'>//对3求余  count根本不是索引 
        </tr>
      </c:if> 
    </c:forEach>
    </c:forEach>
    </table>