Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating multirow table headers

Tags:

vaadin

I have a table where my column headers are set with the following instruction :

table.setColumnHeader

I wonder how can I create multilevel table headers like on this page?

like image 958
Morning Glory Avatar asked Jan 09 '12 15:01

Morning Glory


2 Answers

As of Vaadin 6.7.3, this is currently not possible using the stock Vaadin table component.

There is a Trac issue raised for changing this for Vaadin 7. See https://vaadin.com/forum/-/message_boards/view_message/900369 for more details.

Depending on your requirements, you could hide the table component's header and try to simulate the header (by using a HorizontalLayout, generating your own headers and listening to column resize events); alternatively, you could simply generate your own HTML <table></table> and assign it to a label component.

like image 135
Charles Anthony Avatar answered Sep 18 '22 17:09

Charles Anthony


In Vaadin7 you can set the table header height dynamically by adding following CSS rule to your theme:

  .v-table-header-wrap {
    height: auto;
  }

The only think is that the column separator is not set to 100% of the header row height ...

like image 22
Steffen Avatar answered Sep 19 '22 17:09

Steffen