gpt4 book ai didi

css - 嵌套表增加外部表的宽度

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

我有一个嵌套表:

<table border="0" width="750" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="530">
<table border="0" cellspacing="0" cellpadding="0" width="530">
<tr>
<td>
<tr>
<td width="14"></td>
<td width="177">
<p style="color:#333333; line-height: 20px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight:bold; text-align: left; margin-left: 0px; padding-top: 0px;">Expand Your Reach</p>
<ul style="color:#767676; line-height: 20px; font-size: 12px; font-family: Helvetica, Arial, sans-serif; list-style-image:url(http://demo.frostmiller.com/sss104/images/bullet.jpg);text-align:left; margin-left: 25px; padding:0; list-style-position:outside;">
<li>Contrary to popular belief, Lorem Ipsum is not simply random text. </li>
<li>Contrary to popular belief, Lorem Ipsum is not simply random text. </li>
<li>Contrary to popular belief, Lorem Ipsum is not simply random text. </li>
</ul>
<br />
</td>
<td width="29"></td>
</tr>
<tr>
<td colspan="3">
<hr width="220" />
</td>
</tr>
<tr>
<td width="14"></td>
<td width="177" align="left">
<p style="color:#333333; line-height: 20px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight:bold; text-align: left;">Contact Info</p>
<p style="color:#767676; line-height: 20px; font-size: 12px; font-family: Helvetica, Arial, sans-serif; text-align: left; margin-bottom: 2cm;">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer .</p>
</td>
<td width="29"></td>
</tr>
</td>
</tr>
</table>
</td>
<td width="220">
</td>
</tr>
</table>

我正在创建一个 html 电子邮件,因此除了嵌套表格别无选择。

一旦我将宽度为 530 的内部表格包含在宽度为 530 的单元格中,外部表格的边框就会错位并变宽。我怎样才能阻止它?

最佳答案

  1. 您的 HTML 无效,表格嵌套错误(其中有额外的 trtd 元素)

  2. 数学没有加起来所以很难弄清楚你在做什么,嵌套表是 14+177+29 = 220 但你把它放在 530 细胞

  3. 如果修复嵌套并改变

    <td width="530">
    <table border="0" cellspacing="0" cellpadding="0" width="530">

    到:

    <td width="530">
    <table border="0" cellspacing="0" cellpadding="0" width="100%">

    它应该可以解决任何仍然存在的对齐问题

关于css - 嵌套表增加外部表的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6060056/

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