为什么一个白space可以换行?如何在一行中制作 space(s) 的行

Why one white space could make a new line? How to make the line with space(s) in one line

<table width="600">
  <tbody>
    <tr>
      <td> <span>Price:</span> </td>
      <td width="100%">
        <table width="100%">
          <tbody>
            <tr>
              <td style="width:100%;border-bottom:3px dotted #0b863c">&nbsp;</td>
            </tr>
          </tbody>
        </table>
      </td>
      <td>.9 sdfsdfd fgertwet</td>
    </tr>
  </tbody>
</table>

所以我正在尝试创建一个电子邮件模板。它包含 space 的动态内容。每次当它在第三列中有 space 时,它都会创建一个新行。但我只希望它在一行中。

我知道它适用于 white-space: no-wrap。但是,white-space 不支持 outlook -- https://www.campaignmonitor.com/css/。还有其他想法吗?谢谢!

预计看到:

<table width="600">
  <tbody>
    <tr>
      <td> <span>Price:</span> </td>
      <td width="100%">
        <table width="100%">
          <tbody>
            <tr>
              <td style="width:100%;border-bottom:3px dotted #0b863c">&nbsp;</td>
            </tr>
          </tbody>
        </table>
      </td>
      <td style="white-space: nowrap;">.9 sdfsdfd fgertwet</td>
    </tr>
  </tbody>
</table>

这几乎是 HTML 中文本的默认行为。

如果您可以控制动态内容,则可以将空格替换为 non-breaking 个空格 (&nbsp;),如下例所示。

<table width="600">
  <tbody>
    <tr>
      <td> <span>Price:</span> </td>
      <td width="100%">
        <table width="100%">
          <tbody>
            <tr>
              <td style="width:100%;border-bottom:3px dotted #0b863c">&nbsp;</td>
            </tr>
          </tbody>
        </table>
      </td>
      <td>.9&nbsp;sdfsdfd&nbsp;fgertwet</td>
    </tr>
  </tbody>
</table>