nunu nunu - 4 months ago 14
SQL Question

jquery datatables word wrap not working

My datatable's column looks wider if the value is too long.

enter image description here

i have following this and this.
And setting the width :

aTable = $("#printdata").dataTable({
"bAutoWidth" : false,
"bRetrieve" : true,
"scrollY": 200,
"scrollX": true,
"deferRender": true,
"scroller": {
loadingIndicator: true
"bServerSide": true,
"bProcessing": true,
"sAjaxSource": 'show2ndsampling.php',
"fnServerData": function (sSource,aoData,fnCallback){
"order" : [[1,"desc"]],
"aoColumns" : [
/*serial*/{ "width": "30%", target : 3 }

But there is no change in my datatable.


I would do this

table.dataTable tbody td {
  word-break: break-word;
  vertical-align: top;

demo ->

This is implied that autoWidth is set to false and you have given the columns a fixed width (as in the demo and as OP have described he does with aoColumns / columns).