Wrap Text for One Column
Wrap Text for One Column
vince-carrasco
Posts: 21Questions: 7Answers: 0
in Responsive
http://live.datatables.net/mumababo/1/
I have a long text string, (Description field in the example above), that I want to wrap instead of default nowrap. All of the other columns should not wrap.
The description field is hidden until we expand (+), then at that point we would like to show the Description text wrapping instead of a single, long line of text.
is this possible? Any input is appreciated.
Replies
You had
nowrap
class defined on the table's HTML - if you removed that, the text won't be in a long line, please see updated example: http://live.datatables.net/mumababo/3/editColin
Thank you for looking at this, yes, I agree. But then everything wraps.
The desired solution would be for only the Description column to wrap. All other columns would not wrap.
Maybe you can use a
responsive.details.renderer
to control the output of the child rows. See this example.Kevin
thank you Kevin. researching now.
Kevin's suggestion could be a way even though I don't quite understand how
but that is probably my fault.
I just use columns.data.render
and render one column like this:
I have the opposite requirement: All of my columns wrap and I want this individual one NOT to wrap.
I think all you would need to do is this:
according to this: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space
http://live.datatables.net/namarohe/1/edit
https://datatables.net/reference/option/columns.render
It was a little more difficult for me to make this because I am not used to working with non-ajax sourced data tables.
So I basically used this as a template:
spot-on rt1234, thank you, thank you.