gpt4 book ai didi

asp.net - 对齐不同表格行中的两个元素,使它们的起始位置相同

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

我有一个母版页,其中有一个包含 3 行的表格。第一行是页眉,第二行是正文,第三行是页脚。标题行再次包含一个 1 行 3 列的表格。第一列宽度固定为 238 像素,而最后一列固定为 7% 宽度。中间的列占据了所有的左边空间。

第二行也包含 3 列,第 1 列 = 20%,第 3 列 = 20%,中间占据其余部分。

问题:- 我必须以内部内容从相同水平位置开始的方式排列两个表格的中间列。

这是具有所需样式的 html 示例

<html xmlns="http://www.w3.org/1999/xhtml">

.style1 { 宽度:100%; }

<div align="center">
<table align="center" class="style1">
<tr>
<td>
<div align="center">
<table align="center" class="style1">
<tr>
<td width="238px">
Logo width = 238px</td>
<td align="center">
<div style="background-color: #008000">
start line should aling with the below start line</div>
</td>
<td width="7%">
cart width =7%</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
<table align="center" class="style1">
<tr>
<td width="20%">
&nbsp;</td>
<td align="center">
start line should aling with the top</td>
<td width="20%">
&nbsp;</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>

我需要调整“起始线”(在 div 中 bgcolor = green 和在 td 中),以便它们从相同的位置开始。

最佳答案

<div align="center">
<table align="center" class="style1">
<tr>
<td>
<div align="center">
<table align="center" class="style1">
<tr>
<td width="238px">
Logo width = 238px</td>
<td style="padding-left:50px; background-color: #008000">
start line should aling with the below start line
</td>
<td width="7%">
cart width =7%</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
<table align="center" class="style1">
<tr>
<td width="238px">
&nbsp;</td>
<td style="padding-left:50px;">
start line should aling with the top</td>
<td width="20%">
&nbsp;</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>

使用填充代替 align="center"

关于asp.net - 对齐不同表格行中的两个元素,使它们的起始位置相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19064488/

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