html电子邮件在hotmail和outlook中中断“使用表上浮动时”
我有一封HTML电子邮件,其中包含“迷你表”,它们彼此漂浮在一起 这样我就可以得到两张相对的小桌子;然后,小桌子相互叠在一起 它在雅虎的电子邮件中工作得很好,但在Hotmail、Outlook和手机/平板电脑中崩溃 下面是雅虎电子邮件中的一个示例: 但Outlook和Hotmail中的情况如下: 我在下面附上了我的代码 我使用动态PHP foreach循环从数据库生成数据html电子邮件在hotmail和outlook中中断“使用表上浮动时”,outlook,html-email,hotmail,Outlook,Html Email,Hotmail,我有一封HTML电子邮件,其中包含“迷你表”,它们彼此漂浮在一起 这样我就可以得到两张相对的小桌子;然后,小桌子相互叠在一起 它在雅虎的电子邮件中工作得很好,但在Hotmail、Outlook和手机/平板电脑中崩溃 下面是雅虎电子邮件中的一个示例: 但Outlook和Hotmail中的情况如下: 我在下面附上了我的代码 我使用动态PHP foreach循环从数据库生成数据 foreach ($this->getMembers() as $user) { <td width='
foreach ($this->getMembers() as $user)
{
<td width='310' style='float:left'>
<TABLE width='300' border='0' colour='#FFFFFF' bgcolor='#FFFFFF' style='margin-left: 5px; border: 1px solid #999999; float: left; margin-top: 10px; margin-bottom: 10px'>
<TR>
<TH ROWSPAN=5 width='150' height='150'>
<a href='https://www.bab.com/profile'>
<img src='https://www.bab.com />
</a>
</TH>
<TD width='150' >
{$user->getFirstName()} (Aged: {$user->getActualAge()})
</TD>
</TR>
<TR height='30'>
<TD >
{$user->getCity()}
</TD>
</TR>
<TR >
<TD >
22 Miles Away
</TD>
</TR>
<TR >
<TD>
{$user->getNoYrsWorkExperience()} yrs exp
</TD>
</TR>
<TR >
<TD >
Salary: £ {$user->getSalaryAmount()}/hr
</TD>
</TR>
<TR>
<TH ROWSPAN=3 width='150' height='55'>
<table height='55'>
<tr height='38'>
<td>
<a href='https://www.baby.com/profile/{$user->getId()}'>
<img src='https://www.bab.com/htmlEmailsIcons/contactMe2.png' width='113' height='38' />
</a>
</td>
</tr>
<tr height='10'>
<td>
<a href='https://www.bab.com/profile/{$user->getId()}'>
View My Profile
</a>
</td>
</tr>
</table>
</TH>
</TR>
<TR>
<TD align='center'>
Available From:
</TD>
</TR>
<TR>
<TD>
{$this->availFrom()}- {$this->availTill()}
</TD>
</TR>
上述代码包含在格式正确的HTML电子邮件中。为了简单起见,我没有附上它
如果您能给我一些建议,说明为什么它会在hotmail上被破坏。可能无法解决这个问题,但值得一试:所有其他参数都在单引号内,但TH的rowspan根本不被引用 首先,不要使用浮动。大多数电子邮件客户端无法正确呈现它们。
改为使用“对齐”,如您在电池外壳上的“可从:”上所述-不要使用浮动。几乎没有任何电子邮件客户端支持它。还注意到代码中的其他问题: 图像标记源上没有结束引号 不要使用保证金。使用Cellpadding或cellspacing是最好的,但也可以使用TD padding。 把所有的css放在手稿中,例如-边框大小:1px;边框样式:实心;边框颜色:999999更容易被电子邮件客户端识别和理解。 不一定是错误,但标记中的额外空白。不应该。 行范围号周围没有引号 下面是我能提供的最好的帮助。如果没有更准确的信息放在电子邮件中,这是我能做的最好的。我在下面的代码中添加了开始表标记和结束表标记:
<table>
<tr>
foreach ($this->getMembers() as $user)
{
<td width='310' align="left" style="padding-left:5px; padding-top:10px; padding-bottom:10px;">
<TABLE width='300' align="left" border='0' color='#FFFFFF' bgcolor='#FFFFFF' style='border-size: 1px; border-style: solid; border-color: #999999;'>
<TR>
<TH ROWSPAN="5" width='150' height='150'>
<a href='https://www.bab.com/profile'>
<img src='https://www.bab.com' />
</a>
</TH>
<TD width='150'>
{$user->getFirstName()} (Aged: {$user->getActualAge()})
</TD>
</TR>
<TR height='30'>
<TD >
{$user->getCity()}
</TD>
</TR>
<TR>
<TD>
22 Miles Away
</TD>
</TR>
<TR>
<TD>
{$user->getNoYrsWorkExperience()} yrs exp
</TD>
</TR>
<TR>
<TD >
Salary: £ {$user->getSalaryAmount()}/hr
</TD>
</TR>
<TR>
<TH ROWSPAN="3" width='150' height='55'>
<table height='55'>
<tr height='38'>
<td>
<a href='https://www.baby.com/profile/{$user->getId()}'>
<img src='https://www.bab.com/htmlEmailsIcons/contactMe2.png' width='113' height='38' />
</a>
</td>
</tr>
<tr height='10'>
<td>
<a href='https://www.bab.com/profile/{$user->getId()}'>
View My Profile
</a>
</td>
</tr>
</table>
</TH>
</TR>
<TR>
<TD align='center'>
Available From:
</TD>
</TR>
<TR>
<TD>
{$this->availFrom()}- {$this->availTill()}
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
<table>
<tr>
foreach ($this->getMembers() as $user)
{
<td width='310' align="left" style="padding-left:5px; padding-top:10px; padding-bottom:10px;">
<TABLE width='300' align="left" border='0' color='#FFFFFF' bgcolor='#FFFFFF' style='border-size: 1px; border-style: solid; border-color: #999999;'>
<TR>
<TH ROWSPAN="5" width='150' height='150'>
<a href='https://www.bab.com/profile'>
<img src='https://www.bab.com' />
</a>
</TH>
<TD width='150'>
{$user->getFirstName()} (Aged: {$user->getActualAge()})
</TD>
</TR>
<TR height='30'>
<TD >
{$user->getCity()}
</TD>
</TR>
<TR>
<TD>
22 Miles Away
</TD>
</TR>
<TR>
<TD>
{$user->getNoYrsWorkExperience()} yrs exp
</TD>
</TR>
<TR>
<TD >
Salary: £ {$user->getSalaryAmount()}/hr
</TD>
</TR>
<TR>
<TH ROWSPAN="3" width='150' height='55'>
<table height='55'>
<tr height='38'>
<td>
<a href='https://www.baby.com/profile/{$user->getId()}'>
<img src='https://www.bab.com/htmlEmailsIcons/contactMe2.png' width='113' height='38' />
</a>
</td>
</tr>
<tr height='10'>
<td>
<a href='https://www.bab.com/profile/{$user->getId()}'>
View My Profile
</a>
</td>
</tr>
</table>
</TH>
</TR>
<TR>
<TD align='center'>
Available From:
</TD>
</TR>
<TR>
<TD>
{$this->availFrom()}- {$this->availTill()}
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>