table-cell自动换行不使用斜杠

Bog*_* M. 5 html css word-wrap

我试图将文本包装在固定的布局中,但当文本包含斜杠时它不起作用.

这可以修复而不从Javascript(纯CSS)插入空格?

的jsfiddle:

http://jsfiddle.net/HgBhk/1/

Not working:
<div style="display:table; width:170px; background-color:cyan;">
    <div style="display:table-row">
        <div style="display:table-cell;word-wrap: break-word;">abfdbfdbfdb/dfbfdbdfbfbf/bdffbdbfdfbddfbdfbdfb</div>
        <div style="display:table-cell; width:34px;  background-color:red;">xxxxx</div>        
    </div>
</div>

</br>
Working:
<div style="display:table; width:170px; background-color:cyan;">
    <div style="display:table-row">
        <div style="display:table-cell;word-wrap: break-word;">abfdbfdbfdb dfbfdbdfbfbf bdffbdbfdfbddfbdfbdfb</div>
        <div style="display:table-cell; width:34px;  background-color:red;">xxxxx</div>        
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

Ric*_*Wit 0

添加table-layout:fixed;到“table”div 元素并为单元格指定宽度以使其换行:

JSFiddle