【发布时间】:2017-01-17 23:36:46
【问题描述】:
我有一个动态生成的表,每次刷新页面时都会插入一行新数据。如何限制最多只显示 7 个表行的表,一旦达到 7 个。用数据更新表现有表行而不是添加新行。我的应用程序由前端的 thymeleaf 和后端的 java/springboot 组成。
我在这个脚本中使用百里香叶来自动生成我的代码。
<table th:object="${showbudata}">
<thead>
<tr>
<th> Date </th>
<th> Status </th>
<th> HostName </th>
<th> Implement Version</th>
</tr>
</thead>
<tbody>
<tr th:each="t: ${showbudata}" th:if="${server.host == t.host}">
<td th:text="${t.date}" />
<td th:text="${t.Status}" />
<td th:text="${t.host}" />
<td th:text="${t.version}" />
</tr>
</tbody>
</table>
【问题讨论】:
-
这将是 js 逻辑,因此您应该包含更多内容,而不是 html
标签: javascript html css thymeleaf