【发布时间】:2019-11-14 15:00:00
【问题描述】:
我想在outlook中创建两个相邻的表格,它们应该放在一个带有背景图片的表格中。
我知道可以像这样在 Outlook 电子邮件中创建背景图片:
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;">
<v:fill type="frame" src="image.jpg" color="#F4C046" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td align="center">
<!-- place content here -->
</td>
</tr>
</table>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
我也知道可以像这样创建一个两列表格设计:
<table width="600" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>
<table class="full-width" width="295" align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="left" style="font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: 400; color: #000; line-height: 24px;">
hi
</td>
</tr>
</table>
<table class="full-width" width="295" align="right" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="center">
<img class="img-full" src="image_1.jpg" alt="img" width="295" height="250">
</td>
</tr>
</table>
</table>
但是,当我将上面的表格放入<!-- place content here --> 时,后台正在工作,但这两个表格不是彼此相邻,而是彼此下方。
是否有可能让两者都在 Outlook 中工作?
我不想创建一个包含两列的表,因为它还应该是响应式的。当我有两个表时,我可以简单地使用媒体查询将表的宽度设置为 100%。
如How do I get my two tables to align beside each other? 中所述,我还尝试在两个表上使用浮点数,但这在 Outlook 中也被忽略了。
【问题讨论】:
-
从上述链接中选择的答案是使用浮点数,并非所有电子邮件客户端都能正确读取浮点数。
-
@Syfer float 在背景图像解决方法中也不起作用
-
是的,这就是我推荐幽灵专栏的原因。您可以使用表格的列和行来控制外观。
-
@Syfer ghost columns 不适合我,因为我需要在 2019 年做出响应,正如我的问题中提到的那样。
-
您可以使用幽灵列并使用 CSS 定位这些列并使其具有响应性。
I need responsiveness in 2019上面的描述里没说?
标签: outlook html-email