【问题标题】:How to place a table within a table on top如何在顶部的表格中放置表格
【发布时间】:2012-06-15 04:09:19
【问题描述】:

我正在与 html 客户端对 CSS 的不良支持作斗争,我需要制作一个带有表格布局的电子邮件模板。 我只是无法在表格中正确放置和对齐表格。我用 valign 等尝试过,但这不起作用...

如何将一张桌子放在另一张桌子的顶部和中间?

为了说明我已经发布了这个小提琴: http://jsfiddle.net/eabJh/1/

<td >Another nested table</td> 位于中心位置,但不是在顶部,而是在中间。

这是我的html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title></title>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <body style="background-color: black">
            <table background="http://i3.mirror.co.uk/incoming/article276604.ece/ALTERNATES/s615/tweet-that-ricky-gervais-jibe-at-mongs-pic-twitter-com-rickygervais-132840776.jpg"  width="810" border="20" bordercolor="white" style="border-style:solid; border-spacing:0px; border-collapse:collapse">
                <tr style="height:400px">
                    <td>test
                        <table width="380" cellspacing="0" cellpadding="2" align="center"  border="0">
                            <tr>
                                <td >Another nested table</td>
                            </tr>
                        </table></td>
                </tr>
            </table>

        </body>
    </html>


</html>

【问题讨论】:

    标签: html-table html-email


    【解决方案1】:

    Updated Fiddle

    使用valign = "top":

    <td valign = "top">test
         <table width="380" cellspacing="0" cellpadding="2" align="center"  border="0">
              <tr>
                  <td>Another nested table</td>
              </tr>
         </table>
    </td>
    

    【讨论】:

      猜你喜欢
      • 2019-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-29
      • 1970-01-01
      • 2017-06-20
      • 2015-05-13
      相关资源
      最近更新 更多