Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set column width in Percentage in Vaadin?

Tags:

vaadin

Is it possible to set a columnwidth of the Table in vaadin in percentage.If is it possible tell me how to do it with example code snippet.Thanks in advance.

like image 396
Kumar Avatar asked Dec 10 '22 16:12

Kumar


1 Answers

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

Let's say that you got 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'll get 25% to foo and baz and 50% to bar

like image 119
Jens Jansson Avatar answered Dec 31 '22 13:12

Jens Jansson