table表格的与form表单基础写法
table表格写法:
显示样式
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>tr {
text-align: center;
}
</style>
</head>
<body><!--表格代码部分-->
<table border="1" width="80%" cellspacing="0" cellpadding="5" align="center">
<!--设置标题字体粗体:font-weight: bolder;,设置字体大小:font-size: 1.2em;(1.2倍),字体底部间距:margin-bottom: 10px(10像素)-->
<caption style="font-weight: bolder;font-size: 1.2em;margin-bottom: 10px">实验中学·每周上课时间表</caption>
<tbody>
<tr bgcolor="#FBF2EF">
<th>时间</th>
<th>星期一</th>
<th>星期二</th>
<th>星期三</th>
<th>星期四</th>
<th>星期五</th>
</tr><tr>
<td rowspan="3" bgcolor="#58ACFA">上午</td>
<td>语文</td>
<td>数学</td>
<td>音乐</td>
<td>体育</td>
<td>历史</td>
</tr><tr>
<td>语文</td>
<td>数学</td>
<td>音乐</td>
<td>体育</td>
<td>历史</td>
</tr><tr>
<td>语文</td>
<td>数学</td>
<td>音乐</td>
<td>体育</td>
<td>历史</td>
</tr>
<tr>
<td colspan="6" bgcolor="#FBEFF2">午间休息</td>
</tr>
<tr>
<td rowspan="2" bgcolor="#58ACFA">下午</td>
<td>语文</td>
<td>数学</td>
<td>音乐</td>
<td>体育</td>
<td>历史</td>
</tr>
<tr>
<td>语文</td>
<td>数学</td>
<td>音乐</td>
<td>体育</td>
<td>历史</td>
</tr>
<tr>
<td bgcolor="#F5DA81">备注</td>
<td colspan="5" bgcolor="#F5DA81">每天下午16:00 - 17:00,写完作业再回家</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="6">表格页脚元素</td>
</tr>
</tfoot>
</table>
<!--表格代码部分 end-->
</body>
</html>
## form表单:
- 显示样式
![](https://img.php.cn/upload/image/959/859/838/1616340316679135.jpg)
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form action="demo7.php" method="post">
<fieldset>
<legend>必填项</legend>
<div>
<label for="User_name">账号:</label>
<input type="text" id="User_name" name="User_name" autofocus required placeholder="必须为6-8位">
</div>
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required placeholder="数字加英文组合">
</div>
<div>
<label for="email">邮箱:</label>
<input type="email" id="email" name="email" required placeholder="demo@qq.com">
</div>
</fieldset>
<fieldset>
<legend>性别爱好</legend>
<div>
<label for="mi">性别:</label>
<input type="radio" name="gender" value="男士" id="nan"/><label for="nan">男士</label>
<input type="radio" name="gender" value="女士" id="nv"/><label for="nv">女士</label>
<input type="radio" name="gender" value="保密" id="mi" checked/><label for="mi">保密</label>
</div>
<div>
<label>爱好:</label>
<input type="checkbox" name="aihao[]" id="biancheng" checked><label for="biancheng">编程</label>
<input type="checkbox" name="aihao[]" id="guangjie"><label for="guangjie">逛街</label>
<input type="checkbox" name="aihao[]" id="daqiu" checked><label for="daqiu">打球</label>
<input type="checkbox" name="aihao[]" id="sheying"><label for="sheying">摄影</label>
<input type="checkbox" name="aihao[]" id="jianshen"><label for="jianshen">健身</label>
</div>
</fieldset>
<div>
<label>下拉选择:</label>
<select name="xiala" id="">
<option value="金牌会员">金牌会员</option>
<option value="银牌会员">银牌会员</option>
<option value="至尊会员">至尊会员</option>
<option value="钻石会员">钻石会员</option>
</select>
</div>
<div>
<label>搜索选框:</label>
<input type="search" name="search" id="" list="mykey"/>
<datalist id="mykey">
<option value="苹果手机"></option>
<option value="小米手机"></option>
<option value="华为手机"></option>
<option value="一加手机"></option>
</datalist>
</div>
<div style="margin-top: 10px">
<button type="submit">提交注册</button>
</div>
</form>
</body>
</html>