I'm using jQuery DataTables in my .NET web application but how do I set a max width for one specific column, all the other columns should be auto sized (like they are now in my table)
EDIT
The DataTables did it correctly by itself, the problem was there was a very long word without spaces that cause the problem
Description. Enable or disable automatic column width calculation. This can be disabled as an optimisation (it takes a finite amount of time to calculate the widths) if the tables widths are passed in using columns.
You have two options: Remove columns to make it so it fits within the div element. Set overflow-y to scroll or auto in css on the containing div. This will cut off anything outside the div and allow the user to scroll to see it.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With