【发布时间】:2018-11-19 12:47:13
【问题描述】:
有人能告诉我这些代码有什么问题吗。它只显示第一行和表头信息。thks
`<div class="container">
<div th:if="${not #lists.isEmpty(products)}">
<h2>List of Products</h2>
<table class="table table-striped" th:width="700px">
<tr>
<th>Id</th>
<th>Description</th>
<th>Price</th>
<th>Image Url</th>
</tr>
<tr th:each="product : ${products}">
<td th:text="${product.id}"></td>
<td th:text="${product.description}"></td>
<td th:text="${product.price}"></td>
<td th:text="${product.imageUrl}"></td>
</tr>
</table>
</div>
【问题讨论】:
-
您有两个开始 div 和一个结束 div。这是您在此处所做的复制粘贴中的错误吗?请您复制并粘贴整个页面的 html 代码吗?另外,你有多少产品?能把你的控制器的代码贴出来吗?
标签: thymeleaf