2014-02-26 148 views
0

对不起我的英文不好。表格创建出错

即时消息新的jsp/servlet调用。最近我在jsp中创建了一个表来显示从servlet请求的输出。该servlet将该列表传递给jsp包含3个字段:日期,转码和金额为1个月,并按日期分组。

下面

是我想要做的显示:

date  | revcode | revcode | revcode and so on | total 
2013-02-02 | amount | amount | amount and so on | sum of the amount for that day 

这里是我的代码:

<table class="table table-bordered table-striped table-hover"> 
         <thead> 
         <th> Date </th> 
         <c:forEach var="revcodes" items="${revcodeList}"> 
         <th>${revcodes.revcode}</th> 
         </c:forEach> 
         <!--<th> Total </th>--> 
         </thead> 

         <tr> 
          <td></td> 
          <c:forEach var="revcodeAmount" items="${revcodeList}"> 
           <td>${revcodeAmount.amount}</td> 
          </c:forEach> 

         </tr> 
        </table> 

我不知道如何创建一个表像我上面想。你们能否指引我朝着正确的方向前进?或者我需要使用其他开源API作为表格记录像碧玉报告这样做?

这里是我的截图链接:http://postimg.org/image/62ajljtcn/

+0

尝试运行该代码时是否收到任何错误消息? – CodeMed

+0

@CodeMed,迄今为止。但它不显示,因为我想它是。 –

+0

您可以匿名发布打印屏幕,方法是将其上传到http://postimage.org/,然后将该网址放入发布中的'img'标签。这可以帮助人们看到你不喜欢的东西。 – CodeMed

回答

1

我认为它可以工作:

<table class="table table-bordered table-striped table-hover"> 
<thead> 
    <th> Date </th> 
    <th> Total </th> 
</thead> 
<c:forEach var="revcodes" items="${revcodeList}"> 
    <tr> 
     <td>${revcodes.revcode}</td> 
     <td>${revcodeAmount.amount}</td> 
    </tr> 
</c:forEach> 
</table> 

你也可以使用DisplayTag还显示表格数据骨材这个LIB的帮助,并有选择导出数据。

+0

将显示每一行的revcode,我发布了一些关于我之前想要的内容 –

+0

这里是截图链接:http://postimg.org/image/62ajljtcn/ –

+0

你的表有什么问题? –