Is it possible to set the column width as a percentage in Vaadin?

Is it possible to set the width of a table column in a vaadin as a percentage. If possible, tell me how to do this with a code snippet. Thanks in advance.

+4
source share
1 answer

Yes. Use Table.setColumnExpandRatio (columnId, ratio) for this.

Say you have the properties "foo", "bar" and "baz" in your table. If you do this:

table.setColumnExpandRatio("foo",1); table.setColumnExpandRatio("bar",2); table.setColumnExpandRatio("baz",1); 

you will get 25% for foo and baz and 50% for the bar

+14
source

Source: https://habr.com/ru/post/1308979/


All Articles