jQuery DataTables max column width
Your problem seems more CSS related ...
Using word-wrap in CSS would fix that issue, for columnX just add this to your CSS.
.columnX {
word-wrap: break-word;
}
It would wrap even words without spaces based on your set width for the column.
See: https://developer.mozilla.org/en/css/word-wrap
I agree with the above solution of using the word wrap
- it works great. However, I had further issues with columns with large amounts of data in. I also did the following to get it fully working:
I have had numerous issues with the column widths of datatables
. The magic fix for me was including the line
table-layout: fixed;
This css
goes with the overall css
of the table. For example, if you have declared the datatables
like the following:
LoadTable = $('#LoadTable').dataTable.....
Then the magic css
line would go in the class Loadtable
.
#Loadtable {
margin: 0 auto;
clear: both;
width: 100%;
table-layout: fixed;
}