E.K*_*.K. 5 html text html-table word-wrap twitter-bootstrap
我想使用引导程序将一长段字符串显示到表格单元格中。它包含一些换行符\r\n。style="white-space:pre"我尝试按照stackoverflow 帖子的建议使用,但这会破坏引导程序文本换行。我也尝试过更改,\r\n但<br>没有成功。<br>显示为文本。
这就是我的桌子的样子..
<table id="table1" class="table table-bordered">
<tbody>
<tr>
<th class="col-md-2" scope="row">Description</th>
<td id="description">Very long test with \r\n so I want to show this in multiline and also want to wrap the text using bootstrap.</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
将分页符更改为 HTML 分隔符(br 标记)在 jsfiddle 中效果很好。请参阅下面我的链接。确保生成 HTML 时生成的是实际的 < 和 > 符号,而不是 HTML 代码。
https://jsfiddle.net/joedonahue/zpj94p0b/
<table id="table1" class="table table-bordered">
<tbody>
<tr>
<th class="col-md-2" scope="row">Description</th>
<td id="description">Very long test with <br/> so I want to show this in multiline and also want to wrap the text using bootstrap.</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15650 次 |
| 最近记录: |