Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Grid - preformatted text in column
Hello Everyone! :)
I encountered strange behaviour with Grid component. I wanted to display preformatted text in my Grid. I made BeanItemContainer holding my beans. In "Bean" class I made getter - getContent in which I returns Label with preformatted ContentMode:
Label area = new Label();
area.setValue(text);
area.setContentMode(ContentMode.PREFORMATTED);
area.setSizeFull();
return area;
Unfortunately in my Grid this data is not correctly rendered. I tried HtmlRenderer and in getConten I return String
<pre>....here goes content...</pre>
With this solution result is very suprising - please see attachment grid.png
On the other hand in Table Component there were no problems with rendering Label component - table.png.
Could anyone now how to present preformatted text in Grid? :)
Thanks! :)