1.fetch获取所有用户信息.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>Document</title>
  8. <style>
  9. .user-list {
  10. width: 500px;
  11. margin: 0 auto;
  12. box-shadow: 0 0 2px 5px #ccc;
  13. border-radius: 4px;
  14. padding: 10px;
  15. }
  16. .user-list table {
  17. border-collapse: collapse;
  18. width: 100%;
  19. }
  20. .user-list table tr {
  21. border-top: 1px solid #dedede;
  22. height: 32px;
  23. line-height: 32px;
  24. text-align: left;
  25. }
  26. .user-list table thead tr:first-child {
  27. border: none;
  28. }
  29. .user-list table td,
  30. .user-list table th {
  31. padding-left: 10px;
  32. }
  33. .avatar {
  34. width: 30px;
  35. height: 30px;
  36. border-radius: 50%;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div class="user-list">
  42. <table>
  43. <!-- thead标签给table定义表头 -->
  44. <thead>
  45. <tr>
  46. <th>头像</th>
  47. <th>姓名</th>
  48. <th>密码</th>
  49. <th>年龄</th>
  50. <th>性别</th>
  51. </tr>
  52. </thead>
  53. <tbody id="listBody">
  54. <!-- 动态添加数据 -->
  55. </tbody>
  56. </table>
  57. </div>
  58. <script src="1.js"></script>
  59. </body>
  60. </html>