web前端表格学习

来源:互联网 发布:设备管理类软件 编辑:程序博客网 时间:2024/05/06 22:21
<!DOCTYPE html>
<html>


<head>
<meta charset="UTF-8">
<title></title>
</head>


<body>


<table border="20" cellspacing="30" cellpadding="20"><!--//表格外边框粗细(border),border=0,则内外线框均没有了;外框和内单元格线宽的距离大小(cellspacing);单元格内容与单元格边界之间的空白距离的大小(cellpadding);-->
<tr<!--//一行妈妈-->>
<th<!--//多列孩子//-->>Header<!--//首行th自动加粗强调,且内容默认居于正中央,表格嵌套除外--></th>
<th bgcolor="ff0000" <!--//显示正红色,00到ff;前面两是红色设置,中间两个是绿色设置,后两个是蓝色设置-->>11</th>
</tr>
<tr>
<td width="40%" <!--//父元素的40%-->>Data<!--//内容默认居左边,垂直居中--></td>
<td bgcolor="rgb(255,0,0)" <!--//2的8次,这里显示颜色有问题-->></td>
<td align="center" valign="middle" <!--//内容水平处理 和垂直处理;多处理空格隔开,仅仅规范些,亦可不要-->></td>
</tr>
<tr>
<td height="100px" <!--//100像素-->>Data</td>
</tr>
<tr></tr>
</table>
<dl>
<dt>自定义列表表头</dt>
<dd style="background-color:rgb(255,0,0);"<!--//CSS这里颜色显示正常-->>11</dd>
<dd>22</dd>
</dl>
<table border="1">
<tr>
<th width="200px" height="200px" rowspan="2"<!-- //往下合并-->>
<table border="1">
<!--//表格嵌套,必须在单元格内-->
<tr>
<th>Header</th>
</tr>
<tr>
<td>Data</td>
</tr>
</table>
</th>
</tr>
<tr>
<td width="200px" height="200px" colspan="2" <!--//往左边合并-->>2222</th>
</tr>
</table>
<table>
<tr>
<th width="200px" height="200px">Header</th>
</tr>
<tr>
<td width="200px" height="200px">Data</td>
</tr>
</table>


</body>


</html>
0 0
原创粉丝点击