gpt4 book ai didi

javascript - 垂直对齐 (HTML)

转载 作者:行者123 更新时间:2023-11-28 17:48:24 25 4
gpt4 key购买 nike

有人可以帮我垂直居中对齐表格的前两列吗?请看下面的代码:

 
<table border="1" style="width: 625px;">
<tbody>
<tr>
<td colspan="3" rowspan="1"><b>Property 1</b></td>
</tr>
<tr>
<td colspan="1" rowspan="1">Yellow</td>
<td colspan="1" rowspan="1">Ad</td>
<td colspan="1" rowspan="1">abcdefgfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
<ul>
<li>12345</li>
<li>4556</li>
<li>793</li>
</ul>
</td>
</tr>
</tbody>

目前看起来像这样:

enter image description here

最佳答案

要确保表格垂直对齐,请向表格添加一个类,并在头部添加此 css

.verticalTable tr td {
vertical-align:middle;
}

这是a link

关于javascript - 垂直对齐 (HTML),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46188875/

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