0
我尝试从Thymeleaf和Twitter Bootstrap的元素列表创建表。 表格行应该每个都可以通过点击来放大。带Bootstrap的Thymeleaf:折叠/手风琴表
我试图用标准引导机制与'data-toogle'和'accordion'做到这一点。
问题是我不能让Thymeleaf从列表中打印两行的每个条目。我可以归档的最好的是以下几个问题,即开放主体位于原始表格下。
<table class="table table-striped table-hover">
<thead>
<th>Name</th>
<th>Value</th>
</thead>
<tbody>
<tr th:each="result: ${results}" th:attr="data-target='#accordion_'+${result.name}" data-toggle="collapse" class="accordion-toggle">
<td th:text="${result.name}"></td>
<td th:text="${result.value}"></td>
</tr>
<tr th:each="result: ${results}">
<td colspan="6" class="hiddenRow">
<div class="accordion-body collapse" th:id="'#accordion_'+${result.name}">there is nothing to see here (yet)
</div>
</td>
</tr>
</tbody>
</table>
所以有不同的问题/答案在这里:
- 是否有Thymeleaf一个方法来打印每个列表项的两行?
- 是否有一个更好的机制,可以与Thymeleaf进行可折叠列表项目?
这可能帮助他人打印Thymeleaf两行:http://damienfremont.com/2014/12/19/how -to-expandcollapse-table-rows-with-bootstrap/ – mnzl