Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么我的表格标题将表格行推离了位置?_Html_Html Table - Fatal编程技术网

Html 为什么我的表格标题将表格行推离了位置?

Html 为什么我的表格标题将表格行推离了位置?,html,html-table,Html,Html Table,没有标题,我的桌子看起来很好,很正常。我试着添加一个表格标题,结果把所有东西都推到了不合适的地方。有人能告诉我如何避免这种情况吗 相关代码: <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="white"> <th width="80%"> Let's talk about the wall </th> <tr> <td

没有标题,我的桌子看起来很好,很正常。我试着添加一个表格标题,结果把所有东西都推到了不合适的地方。有人能告诉我如何避免这种情况吗

相关代码:

<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="white">
<th width="80%"> Let's talk about the wall </th>
<tr>
<td width="6%" align="center" bgcolor="white"><font face="arial"><strong></strong></font></td>
<td width="75%" align="center" bgcolor="white"><font face="arial"><strong></strong></font></td>
<td width="19%" align="center" bgcolor="white"><font face="arial"><strong></strong></font></td>
</tr>

我们来谈谈墙吧



然后:

<tr>
<td bgcolor="white"><font face="arial"></font></td>
<td bgcolor="white"><a href="view_topic.php?id=<? echo $rows['id']; ?>"><font face="arial"><? echo $rows['topic']; ?></a><BR></font></td>
<td align="center" bgcolor="white"><font face="arial"></font></td>
</tr>



为了清楚起见,您看到的文本,如“test”、“slaaa”等-我希望它与它所在位置的左侧对齐得更远,这就是当我有一个没有标题的表格时它的位置。

您缺少一个
tr
包装
th
,以及一个
colspan

th{
背景:#ccc;
}
运输署{
背景:#aaa;
}

我们来谈谈墙吧
一些文本
第2列
第3列

标题是一个单元格,但在表格的其余部分,每行有三个单元格。如果希望标题覆盖所有三列,请查看colspan属性。