php——学习笔记,探索表格标签

来源:互联网 发布:mac怎么还原网络设置 编辑:程序博客网 时间:2024/04/29 02:15
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>练习输出表格</title>
</head>


<body>
<table border="5" width="250">
<tbody>
<tr>
<td width="200" height="70" align="center">1</td>
<td width="100" height="50" align="center">2</td>
<td width="100" height="50" align="center">3</td>
</tr>
<tr>
<td width="100" height="50" align="center">4</td>
<td width="100" height="50" align="center">5</td>
<td width="100" height="50" align="center">6</td>
<td width="100" height="50" align="center">6</td>
</tr>
</tbody>
</table>
</body>

</html>


我发现html是先满足在前面的标签,再满足后面的。

<table border="5" width="250">是设置边框粗细为5个像素,宽度是250.因为没有设置长度所以长度由下面的标签决定。

<tbody>是表格体

<tr>为一行

<td>为一格 <td width="200" height="70" align="center">1</td>是设置了表格宽为200个像素,高为70个像素,字体对齐方式居中。

如果说前面表格的大小已经写好,那么这些单元格的大小会首先受到表格大小的限制

0 0
原创粉丝点击