我正在使用表格以表格格式输出一些数据。 (下面只是我实际使用的一个小例子)我正在尝试创建一个 2 列布局。两列都将包含表格行。但是我正在尝试将它们都创建为 td 作为表行的容器。
我的代码是这样的
<table>
<tr>
<td>
<tr><td>I am nested in a table column </td><td>I am also nested in a table column </td></tr>
</td>
<td>
<tr><td>I am nested in the second table column </td><td>I am also nested the second table column </td></tr>
</td>
</tr>
</table>
但由于某种原因,浏览器以不同的方式呈现它......
有人可以帮我让浏览器按照我写的 HTML 代码显示它吗?谢谢!
<table>
<tr>
<td>
<tr><td>I am nested in a table column </td><td>I am also nested in a table column </td></tr>
</td>
<td>
<tr><td>I am nested in the second table column </td><td>I am also nested the second table column </td></tr>
</td>
</tr>
</table>
最佳答案
试试这个:
<table>
<tr>
<td>
<table>
<tr>
<td>I am nested in a table column</td>
<td>I am also nested in a table column</td>
</tr>
<tr>
<td>I am nested in the second table column</td>
<td>I am also nested the second table column</td>
</tr>
</table>
</td>
</tr>
</table>
关于html - 如何将表行嵌套在表列中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24719724/