Blogger Information
Blog 14
fans 0
comment 0
visits 8242
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
表格的使用方法及表单使用方式学习
#三生
Original
809 people have browsed it

table表格标签课程表

table元素一般由5部分组成<!-- table + caption(标题) + thead(头部) + tbody(内容) + tfoot(脚部) -->

表格

  1. <!DOCTYPE html>
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  8. <title>课程表</title>
  9. </head>
  10. <body>
  11. <table border="1" cellspacing="0" cellpadding="1" align="center" style="text-align: center" width="500px" height="450px">
  12. <caption>
  13. <h2>学习课程表</h2>
  14. </caption>
  15. <thead>
  16. <tr style="background-color: #458ee2; color: #fff">
  17. <th>课程</th>
  18. <th>时间</th>
  19. <th>星期一</th>
  20. <th>星期二</th>
  21. <th>星期三</th>
  22. <th>星期四</th>
  23. <th>星期五</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr>
  28. <td rowspan="3">上午</td>
  29. <td>第一节</td>
  30. <td>语文</td>
  31. <td>语文</td>
  32. <td>语文</td>
  33. <td>语文</td>
  34. <td>语文</td>
  35. </tr>
  36. <tr>
  37. <td>第二节</td>
  38. <td>数学</td>
  39. <td>数学</td>
  40. <td>数学</td>
  41. <td>数学</td>
  42. <td>数学</td>
  43. </tr>
  44. <tr>
  45. <td>第三节</td>
  46. <td>英语</td>
  47. <td>英语</td>
  48. <td>英语</td>
  49. <td>英语</td>
  50. <td>英语</td>
  51. </tr>
  52. <tr>
  53. <td colspan="7">午休</td>
  54. </tr>
  55. <tr>
  56. <td rowspan="3">下午</td>
  57. <td>第四节</td>
  58. <td>美术</td>
  59. <td>美术</td>
  60. <td>美术</td>
  61. <td>美术</td>
  62. <td>美术</td>
  63. </tr>
  64. <tr>
  65. <td>第五节</td>
  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. <td>体育</td>
  79. </tr>
  80. <tr>
  81. <td colspan="7">晚休</td>
  82. </tr>
  83. <tr>
  84. <td>晚上</td>
  85. <td>第七节</td>
  86. <td colspan="5">课外学习</td>
  87. </tr>
  88. </tbody>
  89. <tfoot>
  90. <tr>
  91. <td>备注</td>
  92. <td colspan="7">学习向上</td>
  93. </tr>
  94. </tfoot>
  95. </table>
  96. </body>
  97. </html>

form表单

form表单一般由form + input(信息) + button(提交)+action(处理表单程序)部分组成

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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. <form action="three.php" method="get" style="display: grid; gap: 12px; width: 500px">
  11. <div>
  12. <label for="name">账户:</label>
  13. <input type="text" name="name" id="name" placeholder="请输入账号" />
  14. <span>请输入账号</span>
  15. </div>
  16. <div>
  17. <label for="password">密码:</label>
  18. <input type="password" name="password" id="password" placeholder="请输入密码" />
  19. <button onclick="showPassword(this,this.form.password)" type="button">查看</button>
  20. </div>
  21. <div>
  22. <label for="gender">性别:</label>
  23. <select name="gender">
  24. <option value="">请选择</option>
  25. <option value="0"></option>
  26. <option value="1"></option>
  27. <option value="2">保密</option>
  28. </select>
  29. </div>
  30. <div>
  31. <label>爱好:</label>
  32. <input type="checkbox" name="interest[movement]" title="运动" />运动
  33. <input type="checkbox" name="interest[learning]" title="学习" checked />学习
  34. <input type="checkbox" name="interest[enter]" title="娱乐" />娱乐
  35. </div>
  36. <div>
  37. <label>其他:</label>
  38. <input type="radio" name="other" value="1" title="1" />其他1
  39. <input type="radio" name="other" value="2" title="2" checked />其他2
  40. </div>
  41. <div>
  42. <label for="note">备注:</label>
  43. <div>
  44. <textarea name="note" id="note" placeholder="请输入内容"></textarea>
  45. </div>
  46. </div>
  47. <div>
  48. <button type="submit">立即提交</button>
  49. <button type="reset">重置</button>
  50. </div>
  51. </form>
  52. <script>
  53. function showPassword(btn, ele) {
  54. if (ele.type === "password") {
  55. ele.type = "text";
  56. btn.textContent = "隐藏";
  57. } else {
  58. ele.type = "password";
  59. btn.textContent = "显示";
  60. }
  61. }
  62. </script>
  63. </body>
  64. </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