博主信息
博文 14
粉丝 0
评论 0
访问量 12206
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
表格的使用方法及表单使用方式学习
#三生
原创
1029人浏览过

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>
批改老师:PHPzPHPz

批改状态:合格

老师批语:
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学