8
我是新來的百里香葉,想用一個數組和一個循環做一個簡單的表。在百里香葉中創建一張桌子
我的代碼如下所示:
<!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>
的run循環爲<td>
秒。有什麼方法可以使這個代碼工作?
這不起作用becase th:文本沒有關係的循環。 – user3073234
我剛更新了我的答案。 –