<th></th>,th,table header cell,表头单元格
<table border="1" width="200" height="50">
<caption>数字</caption>
<tr>
<th>序号</th>
</tr>
<tr>
<td>1</td>
</tr>
</table>
thead、tbody、tfoot
<table border="1" width="200" height="50">
<caption>数字</caption>
<thead>
<tr>
<th>序号</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>汇总</td>
</tr>
</tfoot>
</table>
属性名 | 属性值 | 说明 |
rowspan | 合并单元格个数 | 合并行,单元格垂直合并 |
colspan | 合并单元格个数 | 合并列,单元格水平合并 |
<td rowspan="跨越的行数"></td>
<td colspan="跨越的列数"></td>
<table border="1" width="200" height="50">
<caption>数字</caption>
<thead>
<tr>
<th>序号</th>
<th>金额</th>
<th>金额</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td rowspan="2">20</td>
<td rowspan="2">20</td>
</tr>
<tr>
<td>2</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>汇总</td>
<td colspan="2">40</td>
</tr>
</tfoot>
</table>
双标签,包裹其它表单标签
<form>
// 表单
</form>
form标签的常用属性
属性 | 说明 |
name | 表单名称 |
method | 提交方式 |
action | 提交地址 |
target | 打开方式 |
enctype | 编码方式 |
name属性
一个页面中,表单可能不止一个。name属性,用来区分不同的表单
<form name="myForm"></form>
method属性
用来指定表单数据使用哪种提交方式给后端
属性值 | 说明 |
get | get方式 |
post | post方式 |
<form method="get"></form>
action属性
用来指定表单数据提交到哪个地址
<!-- 比如提交到index.php地址 -->
<form action="index.php"></form>
target属性
该属性跟a标签的target属性一样,其属性值也是四个,一般情况只用到_blank属性值,默认也是这个值
<form target="_blank"></form>
enctype属性
属性值 | 说明 |
application/x-www-form-urlencoded | 在发送前编码所有字符(默认) |
multipart/form-data | 不对字符编码,在使用包含文件上传控件的表单时,必须使用该值 |
text/plain | 空格转换为 " " 加号,但不对特殊字符编码 |
<form enctype="multipart/form-data"></form>
10.2 input标签
input是单标签
<input type="表单类型">
属性值 | 说明 |
text | 单行文本框 |
password | 密码文本框 |
radio | 单选框 |
checkbox | 多选框 |
button | 普通按钮 |
submit | 提交按钮 |
reset | 重置按钮 |
file | 文件上传 |
单行文本框常用属性
属性 | 说明 |
value | 设置文本框的默认值 |
size | 设置文本框的长度 |
maxlength | 设置最多可输入字符 |
<form>
<input type="text" value="默认值" size="长度" maxlength="可输入字符">
</form>
<form>
<label>姓名:<input type="text" value="曹操" size="20" maxlength="10"></label>
</form>