Blogger Information
Blog 2
fans 0
comment 0
visits 1076
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
列表/表格与表单
小智博客
Original
326 people have browsed it

列表/表格与表单

列表

  1. <!-- 无序列表 -->
  2. <ul>
  3. <li>张无忌</li>
  4. <li>张三丰</li>
  5. <li>张翠山</li>
  6. </ul>
  7. <!-- 有序列表 -->
  8. <ol>
  9. <li>语文</li>
  10. <li>数学</li>
  11. <li>英语</li>
  12. </ol>
  13. <!-- 自定义列表 -->
  14. <dl>
  15. <dt>水果类</dt>
  16. <dd>苹果</dd>
  17. <dd>香蕉</dd>
  18. <dd>桃子</dd>
  19. </dl>

表格

caption表格标题
thead表格头部
tbody表格主题
rowspan行合并
colspan列合并

  1. <!-- 课程表 -->
  2. <table>
  3. <caption>课程表</caption>
  4. <thead>
  5. <tr>
  6. <th colspan="2"></th>
  7. <th>星期一</th>
  8. <th>星期二</th>
  9. <th>星期三</th>
  10. <th>星期四</th>
  11. <th>星期五</th>
  12. <th>星期六</th>
  13. <th>星期日</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <tr>
  18. <td colspan="2">早上</td>
  19. <td colspan="5">晨读</td>
  20. <td rowspan="13"></td>
  21. <td rowspan="13"></td>
  22. </tr>
  23. <tr>
  24. <td colspan="7" class="rest">早上休息</td>
  25. </tr>
  26. <tr>
  27. <td rowspan="4">上午</td>
  28. <td>1</td>
  29. <td>语文</td>
  30. <td>数学</td>
  31. <td>物理</td>
  32. <td>英语</td>
  33. <td>化学</td>
  34. </tr>
  35. <tr>
  36. <td>2</td>
  37. <td>语文</td>
  38. <td>数学</td>
  39. <td>物理</td>
  40. <td>英语</td>
  41. <td>化学</td>
  42. </tr>
  43. <tr>
  44. <td>3</td>
  45. <td>语文</td>
  46. <td>数学</td>
  47. <td>物理</td>
  48. <td>英语</td>
  49. <td>化学</td>
  50. </tr>
  51. <tr>
  52. <td>4</td>
  53. <td>语文</td>
  54. <td>数学</td>
  55. <td>物理</td>
  56. <td>英语</td>
  57. <td>化学</td>
  58. </tr>
  59. <tr>
  60. <td colspan="7" class="rest">中午休息</td>
  61. </tr>
  62. <tr>
  63. <td rowspan="3">下午</td>
  64. <td>1</td>
  65. <td>语文</td>
  66. <td>数学</td>
  67. <td>物理</td>
  68. <td>英语</td>
  69. <td>化学</td>
  70. </tr>
  71. <tr>
  72. <td>2</td>
  73. <td>体育</td>
  74. <td>数学</td>
  75. <td>物理</td>
  76. <td>英语</td>
  77. <td>化学</td>
  78. </tr>
  79. <tr>
  80. <td>3</td>
  81. <td>体育</td>
  82. <td>数学</td>
  83. <td>物理</td>
  84. <td>英语</td>
  85. <td>化学</td>
  86. </tr>
  87. <tr>
  88. <td colspan="7" class="rest">下午休息</td>
  89. </tr>
  90. <tr>
  91. <td rowspan="2">晚自习</td>
  92. <td>1</td>
  93. <td>语文</td>
  94. <td>数学</td>
  95. <td>物理</td>
  96. <td>英语</td>
  97. <td>化学</td>
  98. </tr>
  99. <tr>
  100. <td>2</td>
  101. <td>英语</td>
  102. <td>数学</td>
  103. <td>物理</td>
  104. <td>英语</td>
  105. <td>化学</td>
  106. </tr>
  107. </tbody>
  108. </table>

表单

action 处理表单的程序
method 表单提交类型,分别有GET和POST两种,默认为GET
GET: 数据直接放在url地址中,POST: 表单的数据在请求体中
enctype 表单数据编码,文件上传使用 multipart/form-data,请求类型必须是POST

  1. <form action="" method="post" enctype="multipart/form-data">
  2. <!-- 1,单行文本框 -->
  3. <!-- type: 控件类型 -->
  4. <!-- name: 数据的变量名 -->
  5. <!-- value: 数据的内容 -->
  6. <!-- required: 必填项 -->
  7. <!-- 单行文本框 -->
  8. <div>
  9. <label for="username">账号:</label>
  10. <input type="text" name="username" id="username" value="" placeholder="请输入用户名" required>
  11. </div>
  12. <div>
  13. <label for="email">邮箱:</label>
  14. <input type="email" name="email" id="email" value="" placeholder="请输入邮箱" required>
  15. </div>
  16. <div>
  17. <label for="pwd">密码:</label>
  18. <input type="password" name="pwd" id="pwd" value="" placeholder="请输入密码6-16位字母加数字加字符组合" required>
  19. </div>
  20. <!-- 单选按钮 -->
  21. <!-- checked: 默认值 -->
  22. <div>
  23. <label for="secret">性别:</label>
  24. <input type="radio" name="gender" id="male" value="male">
  25. <label for="male"></label>
  26. <input type="radio" name="gender" id="female" value="female">
  27. <label for="female"></label>
  28. <input type="radio" name="gender" id="secret" value="secret" checked>
  29. <label for="secret">保密</label>
  30. </div>
  31. <!-- 复选框 -->
  32. <!-- 复选框的name属性值应该写成数组的格式名称,这样才确保服务器可以接受到一组值 -->
  33. <div>
  34. <label for="">兴趣爱好:</label>
  35. <input type="checkbox" name="hobby[]" id="game" value="game">
  36. <label for="game">游戏</label>
  37. <input type="checkbox" name="hobby[]" id="shoot" value="shoot">
  38. <label for="shoot">摄影</label>
  39. <input type="checkbox" name="hobby[]" id="travel" value="travel" checked>
  40. <label for="travel">旅游</label>
  41. <input type="checkbox" name="hobby[]" id="program" value="program" checked>
  42. <label for="program">编程</label>
  43. </div>
  44. <!-- 下拉列表 -->
  45. <div>
  46. <label for="edu">学历:</label>
  47. <!-- <select name="edu" id="edu" multiple size="2"> -->
  48. <select name="edu" id="edu">
  49. <option value="1">初中</option>
  50. <option value="2">高中</option>
  51. <option value="3">中专</option>
  52. <option value="4" selected>大专</option>
  53. <option value="5">本科</option>
  54. </select>
  55. </div>
  56. <!-- 隐藏域 -->
  57. <div>
  58. <label for="user-pic">头像:</label>
  59. <!-- 隐藏域:在前端页面中看不到,它的值供后端处理时使用 -->
  60. <input type="hidden" name="MAX_FILE_SIZE" value="80000">
  61. <input type="file" name="user_pic" id="user-pic">
  62. <!-- 头像占位符 -->
  63. <div class="user-pic" style="grid-column: span 2;"></div>
  64. </div>
  65. <div>
  66. <label for="user-resume">简历:</label>
  67. <input type="hidden" name="MAX_FILE_SIZE" value="100000">
  68. <input type="file" name="user_resume" id="user-resume">
  69. <div class="user-resume" style="grid-column: span 2;"></div>
  70. </div>
  71. <!-- 文本域 -->
  72. <div>
  73. <label for="comment">备注:</label>
  74. <textarea name="comment" id="comment" cols="30" rows="5" placeholder="备注信息"></textarea>
  75. </div>
  76. <button>提交</button>
  77. </form>
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