How to give word wrap break word property to a datatable column

試著忘記壹切 提交于 2019-12-13 00:29:04

问题


<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> 

Hi friends, here is my data-table. I want to implement word-wrap break word property to the message column so that long messages with out space will break. Can you please tell me how I should implement the word-wrap break word property to a column in the data-table.


回答1:


Add this class in your css.

#user tbody td:nth-child(2)
{
    word-wrap:break-word !important;
}


来源:https://stackoverflow.com/questions/23715018/how-to-give-word-wrap-break-word-property-to-a-datatable-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!