Overview
If you display data in the Brazos Table or Data Table that contains long stings with no spaces (for example a URL), the table column width will expand to fit the content. This can cause your table to have a larger width than expected or desired. Even if you define the desired column width using the 'column width' configuration variable, the column won't be contratined as specified since there no spaces to properly wrap the text.
Solution
- Add the following css code to your custom Brazos css:
.wrapWord {
word-break: break-all;
} - Then on the Data table, click on your specific Output text field and go to Configuration - Advanced Options - Custom Format Function Name and specify:
formatNum = function(value){return "<div class="wrapWord">"+value+"</div>"}
- Check the 'HTML' Configuration option for the Output Text
The text should now wrap and observe the desired column width.
Comments
1 comment
Hi Oleg,
Thanks for writing this article. I have this requirement in my project. I followed the same steps as you mentioned above but I am getting below message in the cell where I applied this code.
"Formatting function does not exist in any included script"
am I missing something? what should I do to see the actual data instead of this message?
Thanks
Please sign in to leave a comment.