You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让Windows版Outlook中的span按钮实现自动换行?

如何让按钮在Windows版Outlook的单元格内正确换行?

我尝试让按钮在单元格内正确换行,已为单元格设置max-width,并添加宽度为200px的幽灵表格,期望通过限制宽度不超过200px,使<span>自动换行到第二行。该效果在其他客户端均正常,但在Windows版Outlook中失效。

我也曾尝试使用<v:rect>标签,但由于没有固定宽度,该方法无法生效。请问如何让我的<span>列表在Windows版Outlook中正确换行?

代码示例

<table width="100%" style="border-spacing:0; vertical-align: top;width:100%; max-width:200px;display: inline-block;" role="presentation">
   <tr>
      <td style="vertical-align: top;font-size: 12px; margin: 0;font-weight:bold;line-height: 20px;white-space: nowrap;-webkit-text-size-adjust: none;">
         Area |
      </td>
      <td style="vertical-align: middle;text-align:left;">                                             
         <!--[if (gte mso 9)|(IE)]>
            <table width="100%" style="border-spacing: 0;" role="presentation">
            <tr>
            <td width="180" valign="top" style="padding: 0;">
         <![endif]-->
               <span class="area" style="font-size: 12px;margin: 0;Margin-right:2px;padding: 0 4px;background-color:#8936F3;color:#ffffff;margin-top: 0;line-height: 20px;border-radius: 2px;display: inline-block;text-align: center;white-space: nowrap;-webkit-text-size-adjust: none;">
                  <!--[if mso]>
                  <i style="letter-spacing: 3px; mso-font-width: -100%; mso-text-raise: 1pt;">&nbsp;</i>
                  <![endif]-->
                  AB
                  <!--[if mso]>
                  <i style="letter-spacing: 3px; mso-font-width: -100%;mso-text-raise: -1pt;">&nbsp;</i>
                  <![endif]--> 
               </span>
               
               <span class="area" style="font-size: 12px;margin: 0;Margin-right:2px;padding: 0 4px;background-color:#8936F3;color:#ffffff;margin-top: 0;line-height: 20px;border-radius: 2px;display: inline-block;text-align: center;white-space: nowrap;-webkit-text-size-adjust: none;">
                  <!--[if mso]>
                  <i style="letter-spacing: 3px; mso-font-width: -100%; mso-text-raise: 1pt;">&nbsp;</i>
                  <![endif]-->
                  CDEF
                  <!--[if mso]>
                  <i style="letter-spacing: 3px; mso-font-width: -100%;mso-text-raise: -1pt;">&nbsp;</i>
                  <![endif]--> 
               </span>
               
               <span class="area" style="font-size: 12px;margin: 0;Margin-right:2px;padding: 0 4px;background-color:#8936F3;color:#ffffff;margin-top: 0;line-height: 20px;border-radius: 2px;display: inline-block;text-align: center;white-space: nowrap;-webkit-text-size-adjust: none;">
                  <!--[if mso]>
                  <i style="letter-spacing: 3px; mso-font-width: -100%; mso-text-raise: 1pt;">&nbsp;</i>
                  <![endif]-->
                  GHI
                  <!--[if mso]>
                  <i style="letter-spacing: 3px; mso-font-width: -100%;mso-text-raise: -1pt;">&nbsp;</i>
                  <![endif]--> 
               </span>
         <!--[if (gte mso 9)|(IE)]>
            </td>
            </tr>
            </table>
         <![endif]-->
      </td>
   </tr>
</table>

效果对比

  • 预期效果:预期效果(Mac版Outlook及其他客户端均正常显示)
  • 实际效果:实际效果(Windows版Outlook的错误显示)

内容的提问来源于stack exchange,提问作者LanFeusT

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 22:57:12