example_of_table.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>表格</title>
  6. <style>
  7. table {
  8. border-spacing: 0;
  9. }
  10. td, th {
  11. width: 150px;
  12. height: 30px;
  13. border-bottom: 1px solid black;
  14. border-right: 1px solid black;
  15. text-align: center;
  16. empty-cells: hide;
  17. }
  18. .bottom>td {
  19. border-bottom: none;
  20. }
  21. .right {
  22. border-right: none;
  23. }
  24. thead>tr {
  25. background-color: lightgoldenrodyellow;
  26. }
  27. .even {
  28. background-color: lightgrey;
  29. }
  30. .odd {
  31. background-color: lightblue;
  32. }
  33. th:first-child {
  34. border-top-left-radius: 10px;
  35. }
  36. th:last-child {
  37. border-top-right-radius: 10px;
  38. }
  39. tr:last-child>td:first-child {
  40. border-bottom-left-radius: 10px;
  41. }
  42. tr:last-child>td:last-child {
  43. border-bottom-right-radius: 10px;
  44. }
  45. .number li {
  46. /* list-style-type: none; */
  47. list-style-position: inside;
  48. list-style-image: url(images/add.gif);
  49. width: 120px;
  50. height: 30px;
  51. background-color: #006633;
  52. color: white;
  53. text-align: center;
  54. margin: 5px 5px;
  55. float: left;
  56. }
  57. .number li:hover {
  58. color: orange;
  59. cursor: pointer;
  60. }
  61. </style>
  62. </head>
  63. <body>
  64. <!-- table>tr*4>td*5 -->
  65. <table>
  66. <caption>学生考试成绩表</caption>
  67. <thead>
  68. <tr>
  69. <th class="lt" width="120">姓名</th>
  70. <th width="100">语文</th>
  71. <th width="100">数学</th>
  72. <th width="100">英语</th>
  73. <th width="100" class="right">体育</th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <tr class="odd">
  78. <td>王大锤</td>
  79. <td>90</td>
  80. <td>80</td>
  81. <td></td>
  82. <td class="right">60</td>
  83. </tr>
  84. <tr class="even">
  85. <td>王大锤</td>
  86. <td>90</td>
  87. <td></td>
  88. <td>70</td>
  89. <td class="right">60</td>
  90. </tr>
  91. <tr class="bottom odd">
  92. <td>王大锤</td>
  93. <td>90</td>
  94. <td>80</td>
  95. <td>70</td>
  96. <td class="right">60</td>
  97. </tr>
  98. </tbody>
  99. <tfoot>
  100. </tfoot>
  101. </table>
  102. <ul class="number">
  103. <li>One</li>
  104. <li>Two</li>
  105. <li>Three</li>
  106. <li>Four</li>
  107. <li>Five</li>
  108. </ul>
  109. </body>
  110. </html>