Blogger Information
Blog 17
fans 0
comment 0
visits 14799
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
HTML中表格和表单的应用实例 (MD)
未来星
Original
885 people have browsed it

HTML表格制作课程表

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>表格实战:课程表</title>
  6. </head>
  7. <body>
  8. <table
  9. border="1"
  10. width="80%"
  11. cellspacing="0"
  12. cellpadding="5"
  13. align="center"
  14. >
  15. <caption>
  16. <h3>小学三(一)班课程表</h3>
  17. </caption>
  18. <!-- 表头开始 -->
  19. <thead>
  20. <tr bgcolor="lightcyan">
  21. <!-- th:是添加了加粗和居中样式的的td,是td的plus加强版,适合做表头标题 -->
  22. <th>时间</th>
  23. <th>星期一</th>
  24. <th>星期二</th>
  25. <th>星期三</th>
  26. <th>星期四</th>
  27. <th>星期五</th>
  28. </tr>
  29. </thead>
  30. <!-- 表体1: 上午三节课 -->
  31. <tbody align="center">
  32. <tr>
  33. <th rowspan="3">上午</th>
  34. <td>数学</td>
  35. <td>数学</td>
  36. <td>数学</td>
  37. <td>阅读</td>
  38. <td>英语</td>
  39. </tr>
  40. <tr>
  41. <td>语文</td>
  42. <td>体育</td>
  43. <td>语文</td>
  44. <td>数游</td>
  45. <td>数学</td>
  46. </tr>
  47. <tr>
  48. <td>美术</td>
  49. <td>语文</td>
  50. <td>音乐</td>
  51. <td>科学</td>
  52. <td>劳技</td>
  53. </tr>
  54. </tbody>
  55. <!-- 中间休息,整行所有单元格合并 -->
  56. <tbody>
  57. <tr align="center" bgcolor="#dedede">
  58. <td colspan="6">中午休息</td>
  59. </tr>
  60. </tbody>
  61. <!-- 下午课程结构与上午类似,直接复制上午课程的代码 -->
  62. <!-- 下午没有星期几,直接将课程上移到第一行中即可 -->
  63. <tbody align="center">
  64. <tr>
  65. <th rowspan="2">下午</th>
  66. <td>思品</td>
  67. <td>音乐</td>
  68. <td>书法</td>
  69. <td>作文</td>
  70. <td>体育</td>
  71. </tr>
  72. <tr>
  73. <td>美术</td>
  74. <td>体活</td>
  75. <td>英语</td>
  76. <td>作文</td>
  77. <td>省情</td>
  78. </tr>
  79. </tbody>
  80. <!-- 表尾: 底部备注 -->
  81. <tfoot>
  82. <tr bgcolor="lightcyan">
  83. <td>备注:</td>
  84. <!-- 从第2列开始水平合并5列 -->
  85. <td colspan="5">每天下午16:50 放学回家</td>
  86. </tr>
  87. </tfoot>
  88. </table>
  89. </body>
  90. </html>

HTML表单的应用实例

  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. <!-- 表单:get方式数据信息在url中,post方式数据信息在请求体中。 -->
  11. <form action="" method="post">
  12. <div>
  13. <label>用户:<input type="text" /> </label>
  14. </div>
  15. <div>
  16. <label>密码:<input type="password" /></label>
  17. </div>
  18. <div>
  19. <label>邮箱:<input type="text" /> </label>
  20. </div>
  21. <div>
  22. <label for="female">性别:</label>
  23. <input type="radio" name="gender" id="male" value="male" />
  24. <label for="male"></label>
  25. <input type="radio" name="gender" id="female" value="female" />
  26. <label for="female"></label>
  27. </div>
  28. <div>
  29. <label>爱好:</label>
  30. <input type="checkbox" name="hobby[]" id="game" />
  31. <label for="game">游戏</label>
  32. <input type="checkbox" name="hobby[]" id="cooking" />
  33. <label for="cooking">烹饪</label>
  34. <input type="checkbox" name="hobby[]" id="travel" />
  35. <label for="travel">旅游</label>
  36. <input type="checkbox" name="hobby[]" id="shoot" />
  37. <label for="shoot">摄影</label>
  38. </div>
  39. <div>
  40. <label>等级:</label>
  41. <select name="level" id="">
  42. <option value="1">铜牌会员</option>
  43. <option value="2">银牌会员</option>
  44. <option value="3" selected>金牌会员</option>
  45. <option value="4">钻石会员</option>
  46. </select>
  47. </div>
  48. <div>
  49. <label for="">关键字:</label>
  50. <input type="search" name="search" id="" list="my-key" />
  51. <datalist id="my-key">
  52. <option value="html"></option>
  53. <option value="css"></option>
  54. <option value="javacript"></option>
  55. </datalist>
  56. </div>
  57. <div>
  58. <input type="submit" value="提交" />
  59. </div>
  60. </form>
  61. </body>
  62. </html>
Correcting teacher:天蓬老师天蓬老师

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