一、表格完整结构
边框 内容到边框的距离 单元格到单元格之间的距离<table border="1" cellpadding="10" cellspacing="10" align="center/left/right" width="500">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
注:
thead th tfoot 可以省略的
tbody可以有多个
简写结构:
<thead><tbody><tfoot>都去掉了
table的属性:border:1 边框
cellpadding:10 内容到边框的距离
cellspacing:10 单元格到单元格的距离
width:500 宽度
ailgn:center、left、right--水平方向的对齐方式
bgcolor:red 背景颜色
background:"" 背景图像
tr(行)的属性:
height 高
align: left right center
valign:bottom top middle
bgcolor
background:""
td(单元格)的属性
width 宽
height 高
align: left right center
valign:bottom top middle
bgcolor
background:""
表格的高级应用:
1.合并单元格
合并行:垂直合并 rowspan="5"
合并列:水平合并 colspan="5"
2.表格嵌套
在一个表格的某个单元格再写一个表格
之前做页面布局表格
二、表单
表单的作用:负责采集数据的
表单的组成:
表单标签:传输数据的方法及将数据提交的地址
表单元素:输入信息的元素
表单元素:按钮
get 方式提交:是通过地址栏提交的,数据量的限制,不安全
post方式提交:安全,传输的数据量大
<input type="#" name="" value="" >
#:
text 文本框
password 密码框
radio 单选按钮 name=""必须一致
checkbox 复选框 name一般保持一致
hidden 隐藏域
file 文件域
submit 提交按钮 具有提交的作用,通过action提交到某个地址中
reset 重置按钮 具有重置和取消的作用
image 图像域按钮 具有提交的作用
button 普通按钮
<textarea rows="6" cols="30" name=""></textarea>
<select name="">
<option value="0">请选择吧</option>
<option value="1">蓝瘦香菇</option>
</select>
maxlength="10" 最大长度 text password textarea
readonly:只读 text password textarea
checked:选中 radio checkbox
selected:选中 option
size:尺寸 select
multiple:多选 select
三、问题
密码提示问题和密码提示答案 如何一一对应地区问题 省市关联 如何做
爱好问题 如何做到至少选一项
生日下拉表有很多年份 如何自动按序放好