gpt4 book ai didi

html - 将两个表列相互对齐

转载 作者:太空宇宙 更新时间:2023-11-04 16:06:09 24 4
gpt4 key购买 nike

是否可以将这两个表格列对齐,使单元格 1a 与单元格 2a 对齐?现在,左外列似乎垂直居中于右外列

再往下是源码(html),然后是截图

<table>
<tr>
<td>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (1a)</td>
</tr>
<tr>
<td></td>
<td> descr ...</td>
</tr>
</table>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (1b)</td>
</tr>
<tr>
<td></td>
<td> descr ...</td>
</tr>
</table>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (1c)</td>
</tr>
<tr>
<td></td>
<td> descr ...</td>
</tr>
</table>
</td>

<!-- OUTER COLUMN 2 -->
<td>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (2a)</td>
</tr>
<tr>
<td></td>
<td> decr ...</td>
</tr>
</table>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (2b)</td>
</tr>
<tr>
<td></td>
<td> descr ...</td>
</tr>
</table>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (2c)</td>
</tr>
<tr>
<td></td>
<td> descr ...</td>
</tr>
</table>
<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (2d)</td>
</tr>
<tr>
<td></td>
<td> descr ...</td>
</tr>
</table>
</td>
</tr>
</table>

图像 enter image description here

最佳答案

直接html添加valign=top给你先tr:

<table>
<tr valign=top>
<td>

<table class="payment">
<tr>
<td> <input type="checkbox"></td>
<td>info (1a)</td>
</tr>
<tr>

也就是说,除非 class="payment" 样式中的某些东西正在影响定位

关于html - 将两个表列相互对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38020607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com