相当于在Outlook中浮动

相当于在Outlook中浮动,第1张

相当于在Outlook中浮动

使用width =“”而不是CSS在每个对齐的表格上设置宽度。

一个有效的示例:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title>  <style type="text/css">    table td { border-collapse: collapse; }    .msoFix { mso-table-lspace:-1pt; mso-table-rspace:-1pt; }  </style></head><body  bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>    <td align="center">      <div >        <table  width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#CCCCCC">          <tr> <td width="15" bgcolor="454545">&nbsp;</td> <td width="290" bgcolor="454545" align="left" >&nbsp;<br>Table 1<br>...<br>&nbsp; </td> <td width="15" bgcolor="454545">&nbsp;</td>          </tr>        </table>        <table  width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#EEEEEE">          <tr> <td width="15" bgcolor="959595">&nbsp;</td> <td width="290" bgcolor="959595" align="left" >&nbsp;<br>Table 2<br>...<br>&nbsp; </td> <td width="15" bgcolor="959595">&nbsp;</td>          </tr>        </table>      </div>    </td>  </tr></table></body></html>

此外,Outlook在对齐表之间放置4-5像素的间隙。添加此值会将其减少到大约1px:

<style type="text/css">   .msoFix {      mso-table-lspace:-1pt;      mso-table-rspace:-1pt;   }</style>

要完全摆脱它,您必须在表中添加边框(另一个Outlook怪癖hack)。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5112107.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-17
下一篇 2022-11-17

发表评论

登录后才能评论

评论列表(0条)

保存