使用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"> </td> <td width="290" bgcolor="454545" align="left" > <br>Table 1<br>...<br> </td> <td width="15" bgcolor="454545"> </td> </tr> </table> <table width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#EEEEEE"> <tr> <td width="15" bgcolor="959595"> </td> <td width="290" bgcolor="959595" align="left" > <br>Table 2<br>...<br> </td> <td width="15" bgcolor="959595"> </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)。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)