Blogger Information
Blog 7
fans 0
comment 0
visits 2659
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
自主练习3_细说表格(直播跟练版)
柏拉图
Original
681 people have browsed it

表格的属性和标签如下:

  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>细说表格</title>
  8. </head>
  9. <body>
  10. <table border="1" style="background-color: lightsalmon;">
  11. <!-- 标题(可选) -->
  12. <caption style="background-color: lightblue;">
  13. 购物车
  14. </caption>
  15. <!-- 表头 -->
  16. <thead>
  17. <tr>
  18. <th>分类</th>
  19. <th>ID</th>
  20. <th>品名</th>
  21. <th>单价</th>
  22. <th>数量</th>
  23. <th>金额</th>
  24. </tr>
  25. </thead>
  26. <!-- 表体(必选),浏览器自动生成,一个表格可以有多个tbody,但是只能有一个thead -->
  27. <tbody>
  28. <!-- 先写tr,创建一个新行(单元格的容器) -->
  29. <tr>
  30. <!-- td:单元格,数据存放的地方 -->
  31. <!-- yd,th都是单元格,th有预置样式:加粗和居中 -->
  32. <!-- 前三行的第一列,需要做个跨行的合并 -->
  33. <!-- 跨行合并: -->
  34. <!-- 合并属性 rowspan/colspan,必须写到td,th中 -->
  35. <td rowspan="3">数码</td>
  36. <th>5010</th>
  37. <td>电脑</td>
  38. <td>9000</td>
  39. <td>2</td>
  40. <td>18000</td>
  41. </tr>
  42. <tr>
  43. <!-- <td>数码</td> -->
  44. <th>5012</th>
  45. <td>手机</td>
  46. <td>5000</td>
  47. <td>4</td>
  48. <td>20000</td>
  49. </tr>
  50. <tr>
  51. <!-- <td>数码</td> -->
  52. <th>5013</th>
  53. <td>相机</td>
  54. <td>50000</td>
  55. <td>4</td>
  56. <td>20000</td>
  57. </tr>
  58. <tr>
  59. <td rowspan="2">服装</td>
  60. <th>3030</th>
  61. <td>男装</td>
  62. <td>500</td>
  63. <td>2</td>
  64. <td>1000</td>
  65. </tr>
  66. <tr>
  67. <!-- <td>服装</td> -->
  68. <th>3030</th>
  69. <td>女装</td>
  70. <td>300</td>
  71. <td>5</td>
  72. <td>6000</td>
  73. </tr>
  74. </tbody>
  75. <!-- 表尾 -->
  76. <tfoot>
  77. <tr>
  78. <!-- 水平方向合并/列合并:colspan -->
  79. <th colspan="4">总计:</th>
  80. <th>15</th>
  81. <th>74000</th>
  82. </tr>
  83. </tfoot>
  84. </table>
  85. <br />
  86. <button>结算</button>
  87. </body>
  88. </html>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:要是加上运行结果图就好了,记得在https://www.php.cn/member/courses/work.html中提交作业
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post