<table id="user">
<thead>
<tr class="theader">
<th>Order Id</th>
<th>Message</th>
<th>Date Created</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script>
$("#user").dataTable({
"bFilter": false,
"bAutoWidth": false,
"bProcessing" : false,
"bServerSide" : true,
"sAjaxSource" : "./getOrderDetails.cpm"
});
</script> 朋友们,这是我的数据表。我想对message列实现换行换行word属性,以便不带空格的长消息可以换行。您能告诉我应该如何在数据表的列中实现换行换行的单词属性吗?
发布于 2014-05-19 14:11:15
在你的css中添加这个类。
#user tbody td:nth-child(2)
{
word-wrap:break-word !important;
}发布于 2020-02-18 19:28:01
像这样添加内联css,或者为它添加内部css。
style=“空白:正常;换行:换行;换行:正常;宽度:自动”
<tr>
<td class="" style="white-space: normal;word-wrap: break-word;word-break: normal;width:auto"> {{$template->names}}
</td>
<tr>https://stackoverflow.com/questions/23715018
复制相似问题