欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

html常用标签之表格、表单的学习

程序员文章站 2022-06-04 18:22:11
...

课程表

  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. <style>
  9. .kecheng{
  10. background-color: aquamarine;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <table border="1" style="width:300px;text-align: center;">
  16. <caption>小学课程表</caption>
  17. <thead>
  18. <tr>
  19. <th>时间</th>
  20. <th>周一</th>
  21. <th>周二</th>
  22. <th>周三</th>
  23. <th>周四</th>
  24. <th>周五</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <tr class="kecheng">
  29. <td rowspan="4">上午</td>
  30. <td>音乐</td>
  31. <td>数学</td>
  32. <td>美术</td>
  33. <td>语文</td>
  34. <td>数学</td>
  35. </tr>
  36. <tr class="kecheng">
  37. <!-- <td></td> -->
  38. <td>语文</td>
  39. <td>体育</td>
  40. <td>数学</td>
  41. <td>外语</td>
  42. <td>音乐</td>
  43. </tr>
  44. <tr class="kecheng">
  45. <!-- <td></td> -->
  46. <td>外语</td>
  47. <td>电脑</td>
  48. <td>语文</td>
  49. <td>外语</td>
  50. <td>数学</td>
  51. </tr>
  52. <tr class="kecheng">
  53. <!-- <td></td> -->
  54. <td>数学</td>
  55. <td>数学</td>
  56. <td>外语</td>
  57. <td>数学</td>
  58. <td>语文</td>
  59. </tr>
  60. <tr>
  61. <td colspan="6">午休</td>
  62. <!-- <td></td>
  63. <td></td>
  64. <td></td>
  65. <td></td>
  66. <td></td> -->
  67. </tr>
  68. <tr class="kecheng">
  69. <td rowspan="3">下午</td>
  70. <td>语文</td>
  71. <td>外语</td>
  72. <td>数学</td>
  73. <td>音乐</td>
  74. <td>电脑</td>
  75. </tr>
  76. <tr class="kecheng">
  77. <!-- <td></td> -->
  78. <td>语文</td>
  79. <td>体育</td>
  80. <td>数学</td>
  81. <td>数学</td>
  82. <td>外语</td>
  83. </tr>
  84. <tr class="kecheng">
  85. <!-- <td></td> -->
  86. <td>数学</td>
  87. <td>音乐</td>
  88. <td>体育</td>
  89. <td>语文</td>
  90. <td>外语</td>
  91. </tr>
  92. </tbody>
  93. <tfoot>
  94. <tr>
  95. <td colspan="6">搞卫生、回家写作业</td>
  96. </tr>
  97. </tfoot>
  98. </table>
  99. </body>
  100. </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. <style>
  9. .mokuai{
  10. height:35px;
  11. margin-top: 10px;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div style="text-align: center;width: 300px;font-size: 25px;">
  17. <p>用户注册</p>
  18. </div>
  19. <form action="zhuce.php" method="post" style="width:300px;text-align: center;">
  20. <div class="mokuai">
  21. <label for="name">用户名</label>
  22. <input type="text" name="name" id="name" value="" required placeholder="请输入用户名"/>
  23. </div>
  24. <div class="mokuai">
  25. <label for="pwd">密码</label>
  26. <input type="possword" name="pwd" id="pwd" value="" required placeholder="请输入密码"/>
  27. </div>
  28. <div class="mokuai">
  29. <label for="email">邮箱</label>
  30. <input type="email" name="email" id="email" value="" placeholder="请输入邮箱"/>
  31. </div>
  32. <div class="mokuai">
  33. <label for="baomi">性别</label>
  34. <input type="radio" name="sex" id="nan" value="男"/>
  35. <input type="radio" name="sex" id="nv" value="女"/>
  36. <input type="radio" name="sex" id="baomi" value="保密" checked/>保密
  37. </div>
  38. <div class="mokuai">
  39. <label>爱好</label>
  40. <input type="checkbox" name="hao[]" value="吃"/>
  41. <input type="checkbox" name="hao[]" value="喝"/>
  42. <input type="checkbox" name="hao[]" value="玩"/>
  43. <input type="checkbox" name="hao[]" value="学习编程" checked/>学习编程
  44. </div>
  45. <div class="mokuai">
  46. <label>等级</label>
  47. <select id="dengji" name="dengji">
  48. <option value="1">注册用户</option>
  49. <option value="2">论坛用户</option>
  50. <option value="3" selected>课程学员</option>
  51. </select>
  52. </div>
  53. <button>注 册</button>
  54. <!-- <button type="button">按钮</button>
  55. <button type="reset">重置</button> -->
  56. </form>
  57. </body>
  58. </html>

html常用标签之表格、表单的学习

html常用标签之表格、表单的学习