【问题标题】:td element's width doesn't display correctly in HTML emailtd 元素的宽度在 HTML 电子邮件中无法正确显示
【发布时间】:2013-06-18 19:21:48
【问题描述】:

我在显示 td.header 宽度时遇到问题。它一直占据 p.event-detail 的宽度。

谁能帮我修改一下代码,让 td.header 的宽度精确到 530px。

<table bgcolor="#d8d8d8" cellspacing="0" cellpadding="0" border="0">
 <tbody>
  <tr>
   <td width="15" bgcolor="#d8d8d8">
     <p>&nbsp;</p>
   </td>
   <td class="header" width="530" bgcolor="#d8d8d8">
     <h3>Wonderself - Kỹ năng xã hội cho các bé từ 3-6 tuổi</h3>
   </td>
   <td width="15" bgcolor="#d8d8d8">
     <p>&nbsp;</p>
   </td>
  </tr>
  <tr>
   <td width="15" bgcolor="#d8d8d8">
     <p>&nbsp;</p>
   </td>
   <td width="365">
     <p class="event-detail">Chương trình về EQ hàng đầu của Mỹ để giúp các bé từ 3-6 tuổi phát triển kỹ năng xã hội.</p>
     <img src="attend-button.jpg" alt="Attend this event">
   </td>
   <td width="15" bgcolor="#d8d8d8">
     <p>&nbsp;</p>
   </td>
   <td width="150">
     <img src="box.jpg" alt="normal event">
   </td>
   <td width="15" bgcolor="#d8d8d8">
     <p>&nbsp;</p>
   </td>
  </tr>
  <tr height="10" bgcolor="#d8d8d8"></tr>
 </tbody>
</table>

【问题讨论】:

    标签: html-email html-table


    【解决方案1】:

    试试这个

    <td class="header" width="530" bgcolor="#d8d8d8" colspan="2">
    

    【讨论】:

    • 抱歉,请将 colspan 数从 2 更改为 3
    • 有效!谢谢。但我想知道 Outlook 2007 是否牢固地支持 colspan(根据以下讨论)。 stackoverflow.com/questions/14986147/…你在邮件设计中遇到过colspan的问题吗?
    • colspan 是 TD 元素的标准 HTML 属性,必须支持。
    • 我在任何邮件客户端中都没有遇到 colspan 的问题。
    • @Ace colspan 效果很好,所有主要的电子邮件客户端都完全支持它,并且如果您正确设置表格并避免this Outlook 怪癖,则它是一种一致的表格布局方法
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-05
    • 2013-06-06
    • 1970-01-01
    • 2011-04-10
    • 1970-01-01
    相关资源
    最近更新 更多