<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:600px;">
<tr>
<td class="block" align="left" valign="top" style="padding:10px 0;" width="50%">
<img src="http://via.placeholder.com/300">
</td>
<td class="block" align="left" valign="top" style="padding:10px 0 10px 10px;" width="50%">
<p style="font-family: Helvetica, Arial, sans-serif;font-size:18px;line-height:28px;mso-line-height-rule:exactly;color:#262524;">Somebody once told me the world is gonna roll me. I ain't the sharpest tool in the shed. She was looking kind of dumb with her finger and her thumb in the shape of an "L" on her forehead.</p>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:600px;">
<tr>
<td class="bottom" align="left" valign="top" style="padding:10px 0;" width="50%">
<img src="http://via.placeholder.com/300">
</td>
<td class="top" align="left" valign="top" style="padding:10px 0 10px 10px;" width="50%">
<p style="font-family: Helvetica, Arial, sans-serif;font-size:18px;line-height:28px;mso-line-height-rule:exactly;color:#262524;">Well the years start coming and they don't stop coming. Fed to the rules and I hit the ground running. Didn't make sense not to live for fun. Your brain gets smart but your head gets dumb.</p>
</td>
</tr>
</table>
在這種情況下,您將兩個 div 與display: inline-block 。 這使您的內容在桌面上彼此相鄰,並將它們推送到移動設備上。 您的代碼如下所示:
<div style="display:inline-block;vertical-align:top;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 300px;">
<tr>
<td align="left" valign="top">
<img src="http://via.placeholder.com/300">
</td>
</tr>
</table>
</div>
<div style="display:inline-block;vertical-align:top;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:300px;">
<tr>
<td align="left" valign="top" style="padding-left: 10px;">
<p style="font-family: Helvetica, Arial, sans-serif;font-size:18px;line-height:28px;mso-line-height-rule:exactly;color:#262524;">So much to do, so much to see, so what's wrong with taking the back streets? You'll never know if you don't go. You'll never shine if you don't glow.</p>
</td>
</tr>
</table>
</div>
然後我們將所有這些都包裹在一個表格單元格中,並將字體大小設置為 0,這樣就不會在 div 周圍添加額外的空間,並將整個內容對齊表格單元格的中心:
<tr>
<td style="font-size:0;" align="center" valign="top">
<div style="display:inline-block;vertical-align:top;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 300px;">
<tr>
<td align="left" valign="top">
<img src="http://via.placeholder.com/300">
</td>
</tr>
</table>
</div>
<div style="display:inline-block;vertical-align:top;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:300px;">
<tr>
<td align="left" valign="top" style="padding-left: 10px;">
<p style="font-family: Helvetica, Arial, sans-serif;font-size:18px;line-height:28px;mso-line-height-rule:exactly;color:#262524;">So much to do, so much to see, so what's wrong with taking the back streets? You'll never know if you don't go. You'll never shine if you don't glow.</p>
</td>
</tr>
</table>
</div>
</td>
</tr>
可是等等! 由於 Outlook 不支持 div,因此您還需要在所有內容周圍添加一些幻影表以使其在 Outlook 中工作:
<tr>
<td style="font-size:0;" align="center" valign="top">
<!--[if (gte mso 9)|(IE)]>
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 100%;">
<tr>
<td valign="top" style="width: 300px;">
<![endif]-->
<div style="display:inline-block;vertical-align:top;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 300px;">
<tr>
<td align="left" valign="top">
<img src="http://via.placeholder.com/300">
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td><td valign="top" style="width:300px;">
<![endif]-->
<div style="display:inline-block;vertical-align:top;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:300px;">
<tr>
<td align="left" valign="top" style="padding-left: 10px;">
<p style="font-family: Helvetica, Arial, sans-serif;font-size:18px;line-height:28px;mso-line-height-rule:exactly;color:#262524;">So much to do, so much to see, so what's wrong with taking the back streets? You'll never know if you don't go. You'll never shine if you don't glow.</p>
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>