The data in the last column in my data grid repeating panel is too long for the column width, so it’s getting truncated.
How can I make it wrap or split to the next line?
I’ve tried without a control (ie just accepting the default binding) and I’ve tried with a label. It will probably work with a text area but that will look awful.
There are a few CSS rules that set different word wrapping behaviours, so you can experiment to get the text to break in different places. NB: Check the compatibility tables, not all options are univerally supported.
@alcampopiano sadly, overflow-wrap: anywhere is only supported by FireFox.
I recommend using:
word-break: break-all;
This is compatible with all browsers. I’ll update my example to use this instead.
(To overcomplicate matters: word-break: break-all doesn’t give you the ‘break between words if possible’ behaviour, so you could combine it with overflow-wrap: anywhere and word-break: break-word if you wanted that behaviour on Chrome and FireFox. Unfortunately, Edge doesn’t support that behaviour at all! So you’ll need this to get as much ‘breaking between words’ as possible:
word-break: break-all; /* Fallback for Edge */
word-break: break-word; /* Wrap on spaces in Chrome */
overflow-wrap: anywhere; /* Recommended solution for FF */
Luckily, this is only a problem at all where you have elements that contain a really long word as well as some shorter words.)