页面表格及表单元素

表格:有页面布局和展示数据的功能
表格标签:
<table>代表表格开始 </table> 代表表格结束
tr 行标签
td 单元格
width:表格宽度 表格的像素 表格宽度固定 表格的百分比 表格的宽度会随着浏览器的大小改变
border:边框粗细
cellspacing 单元格的边距 单元格与单元格之间的距离 cell单元格 spacing边距
cellpadding 单元格的间距 单元格内容与单元格的距离
一般的表格 cellspacing 与cellpadding的值都是0
bordercolor 边框颜色
align 水平对齐方式 left左对齐 right右对齐 center中间对齐
valign (vertial-align的简写)垂直对齐方式 top靠上 middle居中 bottom靠下
行的width不能用,行只能设置高度 行的宽度外层table定死了
colspan 在行里面合并列 colspan="2" 代表一行里合并两列
rowspan 在列里面合并行() row代表行
th做的标题行可以自带居中加粗

<th>
  <td>xingming</td>
  <td>nianling</td>
</th>

 tbody 所有数据的行可以写在里边

表单元素:
<form action="11.html" method="post" target=></form> form标签写在所有表单元素的最外层
action 可以写网址或者页面的文件 规定了表单提交给谁
method 表示数据在提交的时候使用什么方式提交
get
post
enctype 如果要提交文件使用该属性
(第一类跟第三类 name value元素都要有,因为这个是给数据库送数据的)

1、文本输入类:
文本框;<input type="text" name="yhm" value=""/> 输入
密码框:<input type="password"/>
隐藏域:<input type="hidden"/>
文本域:<textarea rows="10" cols="90"></textarea>
2、按钮类
普通按钮:<input type="button" value="登录"/>
提交按钮:<input type="submit" value="注册"/>
重置按钮:<input type="reset" value="重置"/>
图片按钮:<input type="image" src="图片地址"/>
3、选择输入类
下拉列表<select></select><option></option> name值加在select标签中 value值加在potion标签中

<select name="diqu" >
  <option>huantai</option>
  <option>zhoucun</option>
  <option>zhangdian</option>
</select>

单选按钮<input type="radio" name="sex" value="男"/> name 可以写一样 互斥(性别男女)

<input type="radio" name="sex" value="男"/>
<input type="radio" name="sex" value="nv"/>

复选框 <input type="checkbox" name="" value=""/>

<input type="checkbox" name="zhangsan[]" value="张三"/>张三
<input type="checkbox" name="lisi[]" value="lilisi"/>李四
<input type="checkbox" name="wangmazi[]" value="王麻子"/>王麻

 选择文件<input type="file" name="file"/>

<input type="file" name="file"/>

  

原文地址:https://www.cnblogs.com/gaofangquan/p/6953023.html