html - 如何在 HTML 表中重复数据库中的每个项目?
问题描述
我有这张表,其中第一项显示正常,但在第二次循环迭代中,该表以错误的方式显示:
我正在使用 ThymLeaf 作为前端!
<table>
<tr class="row">
<th class="tableHeader">Nombre</th>
<th class="tableHeader">IP</th>
<th class="tableHeaders">Sistema Operativo</th>
<th class="tableHeaders">Notas</th>
</tr>
<tr class="row">
<td id="datacenterName" th:each="dc : ${datacenterFisicHosts}" th:text="${dc.name}"></td>
<td id="datacenterIp" th:each="dc : ${datacenterFisicHosts}" th:text="${dc.ip}"></td>
<td id="datacenterOS" th:each="dc : ${datacenterFisicHosts}" th:text="${dc.operatingSystem}"></td>
<td id="datacenterNotes" th:each="dc : ${datacenterFisicHosts}" th:text="${dc.notes}"></td>
</tr>
</table>
我想th:each="dc : ${datacenterFisicHosts}"
在相应的表头下对齐循环()中的每个项目。
解决方案
推荐阅读
- python - cv2.VideoCapture 只读取 mpg 文件的一部分
- c++ - 如何在 C++ 中对文本文件进行排序
- elixir - 如何在一个模块 Elixir 中获取所有重复的 genserver 调用
- python - 有没有办法在 Python 中按从 Excel 文件读取的时间格式化(小时:分钟:秒)DATA 执行数学运算(平均和求和)?
- spring-boot - localhost/encrypt 返回未找到但一切都已配置
- wpf - Wpf + Cefsharp 桌面应用程序
- python - scikit-learn 无法为表创建一个热点
- r - 为什么R中的对象大小不同?
- laravel - Laravel 主管随机卡住
- sql - 是否可以在不使用太多逻辑运算符的情况下在一个查询中删除 postgreSQL 数组的所有值?