带有jsf数据表组件的嵌套表

时间:2010-07-04 17:02:23

标签: jsf jsf-2

是否有人知道如何使用JSF生成和填充嵌套表。

预期输出的一个例子:

<table align="center" width="100%" border="1">
  <tr>
    <th colspan="6" scope="col">School
</th>

  </tr>
    <tr>
    <th colspan="6" scope="col">Time
 </th>

  </tr>
    <tr>
    <th colspan="6" scope="col"> Semester </th>

  </tr>

  <tr>
    <th scope="row">Week Commencing</th>
    <th scope="row">Monday</th>
    <th scope="row">Tuesday</th>
    <th scope="row">Wednesday</th>
    <th scope="row">Thursday</th>
    <th scope="row">Friday</th>

  </tr>
  <tr>
  <td>
  <table width="100%"  border="1">
  <tr>
  <td><br /><br />12/04/10<br /><br /> </td>
    <td><table width="100%"  border="1">
  <tr><td>08:30 - 10:00</td></tr>
  <tr><td>10:15 - 11:45</td></tr>
  <tr><td>12:30 - 14:00</td></tr>
  <tr><td>14:15 - 15:45</td></tr>
  <tr><td>16:00 - 17:30</td></tr>
  </table> </td>
  </tr>
  </table>

  </td>
  <td> <table width="100%"  border="1">
  <tr ><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  </table></td>
  <td><table width="100%"  border="1">
  <tr ><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  </table></td>
  <td><table width="100%"  border="1">
  <tr ><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  </table></td>
  <td><table width="100%"  border="1">
  <tr ><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  </table></td>
  <td><table width="100%"  border="1">
  <tr ><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  <tr><td>subject</td></tr>
  </table></td>
  </tr>
</table>

1 个答案:

答案 0 :(得分:2)

不确定它是否正是您想要的,但可以使用<rich:dataTable>内的Richfaces <rich:subTable>创建子表。检查the example