html简单介绍(二)

表格

table标签:
border:表示边框的大小

<table border="1">
<tr>
<td>row(行1), cell(列1)</td>
<td>row(行1), cell(列1)</td>
</tr>
<tr>
<td>row(行2), cell(列2)</td>
<td>row(行2), cell(列2)</td>
</tr>
</table>

合并行时用: 后面的行就不用写女啦
<td rowspan="2">女</td> 
合并列是用:

<td colspan="2">66 , 已婚</td>

<table border="1">
<thead>
<tr>
<th>IP</th>
<th>DNS BOOL</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.1.1.1</td>
<td>True</td>
</tr>
<tr>
<td>2.2.2.2</td>
<td>False</td>
</tr>
</tbody>
</table>

表单

表单元素是允许用户在表单中(比如:文本域、下拉列表、单选框、复选框等等)输入信息的元素
文本:

<form>
username:<input type = "text" name = "username" />
<br />
password:<input type = "password" name = "password" />
<br />
<textarea cols="11" rows="10"></textarea>
</form>

单选

<form>
<input type = "radio" name = "sex" value = "男" /><br />
<input type = "radio" name = "sex" vulue = "女" /><br />
</form>

多选

<form>
<input type = "checkbox" name = "111" />1 <br />
<input type = "checkbox" name = "222" />2 <br />
<input type = "checkbox" name = "333" />3 <br />
<input type = "checkbox" name = "444" />4 <br />
</form>

下拉列表

disabled = "disabled" 禁用该下拉列表
size = "2" 下拉列表可见选项的数目

<form>
<select name = "list" disbaled = "disabled"size = "4">
<option>list1</option>
<option>list2</option>
<option>list3</option>
</form>

当用户单击确认按钮时,表单的内容会被传送到另一个文件。表单的动作属性定义了目的文件的文件名。

<form action = "html.do" method = "get">
username:<input tyep = "text" name = "username" />
<input type = "submit" value = "提 交" />
</form>
原文地址:https://www.cnblogs.com/yangjian319/p/9307783.html