Blogger Information
Blog 3
fans 0
comment 1
visits 1794
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
html表格作业
手机用户1601922620
Original
911 people have browsed it

通过学习代码如下:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>商品管理</title>
  7. </head>
  8. <body>
  9. <!-- 作业内容:写一个商品信息表,要求有id,品名,价格,数量,金额等字段, 最后要有合计,如总数, 总金额,
  10. 并且商品按品类进行合并显示,
  11. 要求用到行与列的合并, 别怕失败,多写几次,就对表格的编写就熟练了。 -->
  12. <table border="1" width="90%" cellspacing="0" cellpadding="5">
  13. <!-- 标题 -->
  14. <caption>
  15. 商品库存信息
  16. </caption>
  17. <!-- 表头 -->
  18. <thrad>
  19. <tr bgcolor="green">
  20. <th>商品编号</th>
  21. <th>商品名称</th>
  22. <th>商品价格</th>
  23. <th>商品数量</th>
  24. <th>商品规格</th>
  25. </tr>
  26. </thrad>
  27. <!-- 表体 -->
  28. <!-- center表示居中 -->
  29. <!-- bgcolor表示颜色赋值 -->
  30. <tbody align="center"bgcolor="lightcyan">
  31. <tr>
  32. <td>001</td>
  33. <td>裙子</td>
  34. <td>100</td>
  35. <td>1</td>
  36. <td>L</td>
  37. </tr>
  38. <tr>
  39. <td>001</td>
  40. <td>牛仔裤</td>
  41. <td>200</td>
  42. <td>1</td>
  43. <td>XL</td>
  44. </tr>
  45. <tr>
  46. <td>001</td>
  47. <td>外套</td>
  48. <td>300</td>
  49. <td>1</td>
  50. <td>M</td>
  51. </tr>
  52. <tr>
  53. <td>001</td>
  54. <td>衬衣</td>
  55. <td>80</td>
  56. <td>1</td>
  57. <td>XXL</td>
  58. </tr>
  59. <tr>
  60. <td>001</td>
  61. <td>鞋子</td>
  62. <td>400</td>
  63. <td>1</td>
  64. <td>L</td>
  65. </tr>
  66. <tr>
  67. <td>001</td>
  68. <td>帽子</td>
  69. <td>50</td>
  70. <td>1</td>
  71. <td>M</td>
  72. </tr>
  73. </tbody>
  74. <!-- 表尾 -->
  75. <tfoot>
  76. <tr>
  77. <td colspan="4" bgcolor="red">进货价格总计</td>
  78. <td bgcolor="yellow">1130元</td>
  79. </tr>
  80. </tfoot>
  81. </table>
  82. </body>
  83. </html>

最终显示效果:

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!