【发布时间】:2014-08-28 03:26:24
【问题描述】:
我是 thymeleaf 的新手,正在尝试使用数组和 each 循环制作一个简单的表格。
我的代码如下所示:
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Smoke Tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<table border="1" style="width:300px">
<tr>
<td>Test Name</td>
</tr>
<tr th:each="smokeTest : ${smokeTests}">
<td>
th:text="${smokeTest.name}">A Smoke Test'
</td>
</tr>
</table>
</body>
</html>
基本上我的问题是我不能在<tr>s 内以<td>s 的身份运行循环。这段代码有什么办法可以工作吗?
【问题讨论】:
标签: html html-table each thymeleaf