In Vaadin, a HorizontalLayout gives each component exactly the space it needs as long as there is enough of it and not more.
In a table created with a BeanItemContainer however, all the columns have the same width. Because the table content is loaded dynamically, the width is different each time and different PCs have different font sizes, we don't want to specify a fixed width in pixels.
How can we tell the row to behave like a html table or a HorizontalLayout in that it gives each row the right width, not more and not less?
setColumnWidth(-1) should activate auto-scaling. Though this is usually the default (even with BeanItemContainers, so I'm surprised you aren't seeing that behaviour automatically. A related concept, possibly worth you pursuing is setSizeUndefined() which is a method of the Sizeable interface.
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