[英]Why am I getting odd html table results with this standard syntax?
我在wordpress网站上使用此代码,但结果却很奇怪。 我想将表格行分为两列,但最后只在侧面粘贴了一点。 我究竟做错了什么?
<table>
<tr>
<td style="padding:0px;">
deleted the content to make this less to read
</td>
</tr>
<tr>
<td style="padding:0px;">
this is a test
</td>
<td style="padding:0px;">
as is this
</td>
</tr>
<tr>
<td style="padding:0px;">
deleted the content to make this less to read
</td>
</tr>
<tr>
<td style="padding:0px;">
deleted the content to make this less to read
</td>
</tr>
<tr>
<td style="padding:0px;">
deleted the content to make this less to read
</td>
</tr>
</table>
我从边缘得到了一些奇怪的东西,而不是我想要的分割:
可能与下表中对齐的右图像内容有关吗?
表中的列数必须恒定。
将colspan="2"
添加到您的单个单元格中。
一个表的列数与其中最多列的行数相同。 如果其他行中缺少单元格,则将它们从渲染中排除,并且单元格不会拉伸到适合的程度。
使用colspan
使一个单元格占用多列。
就您而言,您似乎根本没有表格数据,因此请不要首先使用表格。
您的第二行是两列宽,但是其余行的宽度仍然仅为一列。 将第二列添加到其他每行中,或者扩展其他列中的单元格,使其覆盖两列,如下所示:
<tr>
<td style="padding:0px;" colspan=2>
deleted the content to make this less to read
</td>
</tr>
您需要对只有一列的所有行执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.