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

Spencer Wieczorek
  • 21,229
  • 7
  • 44
  • 54
user2992777
  • 71
  • 1
  • 3
  • 8

2 Answers2

1

Add this class in your css.

#user tbody td:nth-child(2)
{
    word-wrap:break-word !important;
}
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Suresh Ponnukalai
  • 13,820
  • 5
  • 34
  • 54
0

add inline css like this or internal css for it.

style="white-space: normal;word-wrap: break-word;word-break: normal;width:auto"

<tr> 
<td class="" style="white-space: normal;word-wrap: break-word;word-break: normal;width:auto"> {{$template->names}}
</td>
<tr>