list.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8"/>
  5. <title>userList</title>
  6. <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
  7. </head>
  8. <body class="container">
  9. <br/>
  10. <h1>用户列表</h1>
  11. <br/><br/>
  12. <div class="with:80%">
  13. <table class="table table-hover">
  14. <thead>
  15. <tr>
  16. <th>#</th>
  17. <th>User Name</th>
  18. <th>Password</th>
  19. <th>Age</th>
  20. <th>Edit</th>
  21. <th>Delete</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. <tr th:each="user : ${users}">
  26. <th scope="row" th:text="${user.id}">1</th>
  27. <td th:text="${user.userName}">neo</td>
  28. <td th:text="${user.password}">Otto</td>
  29. <td th:text="${user.age}">6</td>
  30. <td><a th:href="@{/toEdit(id=${user.id})}">edit</a></td>
  31. <td><a th:href="@{/delete(id=${user.id})}">delete</a></td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. <div class="form-group">
  37. <div class="col-sm-2 control-label">
  38. <a href="/toAdd" th:href="@{/toAdd}" class="btn btn-info">add</a>
  39. </div>
  40. </div>
  41. </body>
  42. </html>