在Edge中的表格中断词

我有一张这样的桌子:

<div class="container">
  <div class="row">
    <div class="col-12">
      <table>
        <tbody>
          <tr>
            <td>some content</td>
            <td>http://insertreallylongurlhere</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>

我正在使用此CSS:

body {word-break: break-word;}

在Edge上的移动设备(或较小的屏幕尺寸)上,长网址不会中断并在屏幕外溢出。

除了在Edge中,它工作正常。我知道Edge不太喜欢断字:断字。

因此,我在表和td上都尝试了自动换行:断行和溢出自动换行:断行。但是,表似乎不喜欢这样。

如果我在表格中添加了table-layout:fixed和宽度(例如width:100%),则文字会自动换行,但是width样式会破坏我的表格。它超出了我的div范围。

有人知道这个问题的另一种解决方案吗?

lyjzqxg188 回答:在Edge中的表格中断词

尝试使用Wtrealm属性,更多详细信息,请检查the overflow-wrap CSS property

此外,您还可以尝试使用https://app2.test.com属性,而不是overflow-wrap: break-word;

word-break: break-all;

结果如下:

enter image description here

本文链接:https://www.f2er.com/3147141.html

大家都在问