关于HTML的两个实例

例子一:使用HTML语言编写一个菜单

代码如下:

<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
	<title>菜谱</title>
</head>
<body>
<table border="1">
	<tr>
		<th colspan="5">星期一菜谱</th>
	</tr>
	<tr>
		<th rowspan="2">素菜</th>
		<th colspan="3">清炒茄子</th>
		<th>花椒扁豆</th>
	</tr>
	<tr>
		<th colspan="3">小葱豆腐</th>
		<th>炒白菜</th>
	</tr>
	<tr>
		<th rowspan="2">荤菜</th>
		<th colspan="3">油闷大虾</th>
		<th>海参鱼翅</th>
	</tr>
	<tr>
		<th colspan="3">红烧肉</th>
		<th>烤全羊</th>
	</tr>
</table>
</body>
</html>

例子二:使用HTML语言编写一个课程表

代码如下:

<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
	<title>课程表</title>
</head>
<body>
<table border="1">
	<tr>
		<th>项目</th>
		<th colspan="5" >上课</th>
		<th colspan="2">休息</th>
	</tr>
	<tr>
		<th>星期</th>
		<th>星期一</th>
		<th>星期二</th>
		<th>星期三</th>
		<th>星期四</th>
		<th>星期五</th>
		<th>星期六</th>
		<th>星期日</th>
	</tr>
	<tr>
		<th rowspan="4">上午</th>
		<th>语文</th>
		<th>数学</th>
		<th>英语</th>
		<th>英语</th>
		<th>物理</th>
		<th>计算机</th>
		<th rowspan="4">休息</th>
	</tr>
	<tr>
		<th>数学</th>
		<th>数学</th>
		<th>地理</th>
		<th>历史</th>
		<th>化学</th>
		<th>计算机</th>
	</tr>
	<tr>
		<th>化学</th>
		<th>语文</th>
		<th>体育</th>
		<th>历史</th>
		<th>地理</th>
		<th>计算机</th>
	</tr>
	<tr>
		<th>政治</th>
		<th>英语</th>
		<th>体育</th>
		<th>历史</th>
		<th>地理</th>
		<th>计算机</th>
	</tr>
	<tr>
		<th rowspan="2">下午</th>
		<th>语文</th>
		<th>数学</th>
		<th>英语</th>
		<th>英语</th>
		<th>物理</th>
		<th>计算机</th>
		<th rowspan="2">休息</th>
	</tr>
	<tr>
		<th>数学</th>
		<th>数学</th>
		<th>地理</th>
		<th>历史</th>
		<th>化学</th>
		<th>计算机</th>
	</tr>

</table>
</body>
</html>
posted @ 2017-08-01 19:13  renpingsheng  阅读(229)  评论(0编辑  收藏  举报