(网页)表格的边距底部



我正在制作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>

我也尝试了填充底部,也什么都不做。

那么使用<br>是唯一的方法吗?似乎有点尴尬。

您使用边距的方式不正确。边距必须位于样式属性内。其他属性是特定于表的属性,通常只能直接在表上使用。 您可以使用边距,但如果我是你,我会使用 <br/> 标签,因为所有设备都将始终以相同的方式呈现该标签。对于某些电子邮件系统(如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>

最新更新