Blogger Information
Blog 8
fans 0
comment 0
visits 5843
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
表格以及表单的基础知识
无声胜有声丶
Original
633 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. <style>
  9. td {
  10. text-align: center;
  11. }
  12. caption {
  13. font-weight: bold;
  14. }
  15. .thead,
  16. .connect {
  17. background-color: #ccc;
  18. }
  19. </style>
  20. <body>
  21. <table border="1" cellspacing="0" cellpadding="10" width="600">
  22. <caption>
  23. 商品交接清单
  24. </caption>
  25. <thead class="thead">
  26. <th>产品名称</th>
  27. <th>规格型号</th>
  28. <th>商品单价</th>
  29. <th>交接数量</th>
  30. <th>金额</th>
  31. </thead>
  32. <tbody>
  33. <tr>
  34. <td>手机1</td>
  35. <td>型号1</td>
  36. <td>2000</td>
  37. <td>5件</td>
  38. <td>10000</td>
  39. </tr>
  40. <tr>
  41. <td>手机2</td>
  42. <td>型号2</td>
  43. <td>3000</td>
  44. <td>2件</td>
  45. <td>6000</td>
  46. </tr>
  47. <tr>
  48. <td>电脑1</td>
  49. <td>型号2</td>
  50. <td>5000</td>
  51. <td>3件</td>
  52. <td>15000</td>
  53. </tr>
  54. </tbody>
  55. <tfoot>
  56. <tr>
  57. <td colspan="3">合计:</td>
  58. <td>12件</td>
  59. <td>3.9万</td>
  60. </tr>
  61. <tr>
  62. <td colspan="5" class="connect">交接情况</td>
  63. </tr>
  64. <tr>
  65. <td>收货部门</td>
  66. <td></td>
  67. <td rowspan="2" colspan="3" style="text-align: left;">备注:</td>
  68. </tr>
  69. <tr>
  70. <td>收货人</td>
  71. <td></td>
  72. </tr>
  73. </tfoot>
  74. </table>
  75. </body>
  76. </html>

表格

用户注册表单

个人简历注册表:

  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. <style>
  9. fieldset {
  10. background-color: greenyellow;
  11. border-radius: 10px;
  12. }
  13. form {
  14. width: 500px;
  15. }
  16. </style>
  17. <body>
  18. <h3>个人简历注册表</h3>
  19. <!-- form表单元素 -->
  20. <!-- GET:用户提交的数据将会以数值的方式出现在地址栏中(不保密) -->
  21. <!-- POST:方式发送,数据更加安全 -->
  22. <!-- GET和POST:可同时发送 -->
  23. <form>
  24. <!-- 表单域:fieldset -->
  25. <fieldset>
  26. <!-- 分组标签 -->
  27. <legend>必填信息</legend>
  28. <!-- 姓名 -->
  29. <div>
  30. <label for="user_name">姓名:</label>
  31. <!-- 单行文本框 -->
  32. <input
  33. type="text"
  34. name="user_name"
  35. value=""
  36. placeholder="不少于2个字符"
  37. id="user_name"
  38. required="required"
  39. autofocus
  40. />
  41. </div>
  42. <!-- 密码 -->
  43. <div>
  44. <label for="password">密码:</label>
  45. <input
  46. type="password"
  47. name="password"
  48. value=""
  49. placeholder="不少于10个字符"
  50. id="password"
  51. required
  52. />
  53. </div>
  54. <!-- 年龄 -->
  55. <div>
  56. <label for="">年龄:</label>
  57. <!-- 数值输入框 -->
  58. <!-- number:数值 -->
  59. <input
  60. type="number"
  61. name="nian"
  62. min="18"
  63. max="60"
  64. step="2"
  65. value="18"
  66. />
  67. </div>
  68. <!-- 婚姻状况 -->
  69. <div>
  70. <label for="">婚姻:</label>
  71. <!-- 下拉列表 -->
  72. <!-- selected:默认 -->
  73. <select name="education" id="">
  74. <option value="">--状态--</option>
  75. <option value="">已婚</option>
  76. <option value="">未婚</option>
  77. <option value="">单身</option>
  78. </select>
  79. </div>
  80. <!-- 现住地址 -->
  81. <div>
  82. <label for="site">现住地址:</label>
  83. <!-- 单行文本框 -->
  84. <input
  85. type="text"
  86. name="site"
  87. placeholder="现住地址"
  88. id="site"
  89. required
  90. />
  91. </div>
  92. <!-- 性别 -->
  93. <div>
  94. <label for="secret">性别:</label>
  95. <!-- 单选按钮 -->
  96. <input type="radio" name="gender" id="male" /><label for="male"
  97. ></label
  98. >
  99. <input type="radio" name="gender" id="female" /><label for="female"
  100. ></label
  101. >
  102. <input type="radio" name="gender" id="secret" checked /><label
  103. for="secret"
  104. >保密</label
  105. >
  106. </div>
  107. <!-- 爱好 -->
  108. <div>
  109. <label>爱好:</label>
  110. <!-- 复选框按钮 -->
  111. <input type="checkbox" name="hobby[]" id="angling" /><label
  112. for="angling"
  113. >钓鱼</label
  114. >
  115. <input type="checkbox" name="hobby[]" id="game" checked /><label
  116. for="game"
  117. >游戏</label
  118. >
  119. <input type="checkbox" name="hobby[]" id="running" /><label
  120. for="running"
  121. >跑步</label
  122. >
  123. <input type="checkbox" name="hobby[]" id="basketball" /><label
  124. for="basketball"
  125. >篮球</label
  126. >
  127. </div>
  128. <!-- 文件上传/文件域 -->
  129. <div>
  130. <label for="user-img">资格证书:</label>
  131. <!-- 上传文件 -->
  132. <input type="file" name="user-img" id="user-img" />
  133. <!-- 文件大小 -->
  134. <!-- 隐藏域 -->
  135. <input type="hidden" name="MAX_FILE_SIZE" value="7340032" />
  136. </div>
  137. </fieldset>
  138. <fieldset>
  139. <legend>选填信息</legend>
  140. <!-- 预定义复合框 -->
  141. <div>
  142. <label for="my-course">喜欢的课程:</label>
  143. <!-- 属性绑定,才能显示 -->
  144. <input type="my-course" type="text" list="course" />
  145. <!-- 定义下拉列表 -->
  146. <datalist id="course">
  147. <option value="html5">html5</option>
  148. <option value="css">css</option>
  149. <option value="php">php</option>
  150. </datalist>
  151. </div>
  152. <!-- 邮箱文本框 -->
  153. <div>
  154. <label for="my-email">个人的邮箱:</label>
  155. <!-- 这里要做到数据校验 -->
  156. <input type="email" name="email" placeholder="8888@email.com" />
  157. </div>
  158. <!-- 毕业学校 -->
  159. <div>
  160. <label for="school">毕业学校:</label>
  161. <!-- 单行文本框 -->
  162. <input
  163. type="text"
  164. name="school"
  165. value=""
  166. placeholder="不少于10个字符"
  167. id="school"
  168. />
  169. </div>
  170. <!-- 出生日期 -->
  171. <div>
  172. <label for="">出生日期:</label>
  173. <!-- 出生日期文本框 -->
  174. <input type="date" name="brithday" />
  175. </div>
  176. <!-- 调色板 -->
  177. <div>
  178. <label for="" style="text-align: right;">喜欢颜色:</label>
  179. <!-- 调色板:color -->
  180. <input type="color" name="pick_color" />
  181. </div>
  182. <!-- 下拉列表 -->
  183. <div>
  184. <label for="">学历:</label>
  185. <!-- 下拉列表 -->
  186. <!-- selected:默认 -->
  187. <select name="education" id="">
  188. <option value="">--学历--</option>
  189. <option value="">中学</option>
  190. <option value="">大学</option>
  191. <option value="">研究生</option>
  192. <option value="">博士</option>
  193. </select>
  194. </div>
  195. <!-- 个人评价 -->
  196. <div>
  197. <label>个人评价:</label>
  198. <!-- 多行文本框 -->
  199. <textarea cols="50" rows="5"></textarea>
  200. </div>
  201. </fieldset>
  202. <!-- 按钮 -->
  203. <div>
  204. <button
  205. formmethod="GET"
  206. formaction="login.php?action=login"
  207. formtarget="_blank"
  208. >
  209. 登录
  210. </button>
  211. <button
  212. formmethod="POST"
  213. formaction="register.php?action=register"
  214. formtarget="_blank"
  215. >
  216. 提交
  217. </button>
  218. </div>
  219. </form>
  220. </body>
  221. </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