【问题标题】:(HTML) Margin bottom for tables?(HTML) 表格的边距底部?
【发布时间】:2018-04-16 14:01:36
【问题描述】:

我正在制作一封 HTML 电子邮件,加载这些电子邮件的程序不接受单独的 CSS 文件,因此所有内容都必须内联。由于某种原因,表格的边距不起作用。我只需要一张桌子底部和下一张桌子之间的空隙。

到目前为止我所拥有的:

<table width="600" margin-bottom="50" cellpadding=8 cellspacing=0 border=0>
  //contents of table
</table>

<table width="600" cellpadding="0" cellspacing="0" border="0">
  //contents of next table
</table>

根本没有创建间隙。

这行得通:

<table width="600" cellpadding=8 cellspacing=0 border=0>
  //contents of table
</table>

<br>

<table width="600" cellpadding="0" cellspacing="0" border="0">
  //contents of next table
</table>

我也尝试了 padding-bottom,也没有做任何事情。

那么使用&lt;br&gt; 是唯一的方法吗?好像有点尴尬。

【问题讨论】:

  • 这与我的问题完全无关。我已经在使用内联样式(字面意思是我问题的第一句话)并使用表格。

标签: css html-table html-email margin padding


【解决方案1】:

您使用边距的方式不正确。边距必须在样式属性内。其他属性是特定于表的属性,通常只能直接在表上使用。你可以使用边距,但如果我是你,我会使用 &lt;br/&gt; 标签,因为所有设备都会以相同的方式呈现它。某些电子邮件系统(如 Outlook)的边距可能有点不确定。

<table width="600" style="margin-bottom:50px;" cellpadding=8 cellspacing=0 border=0>
  //contents of table
</table>

<table width="600" cellpadding="0" cellspacing="0" border="0">
  //contents of next table
</table>

【讨论】:

    猜你喜欢
    • 2014-01-17
    • 1970-01-01
    • 2017-03-29
    • 2017-10-05
    • 2015-11-21
    • 1970-01-01
    • 2015-09-15
    • 1970-01-01
    • 2012-11-06
    相关资源
    最近更新 更多