Creating multi-row table headers

I have a table where my column headers are given with the following statement:

table.setColumnHeader 

I wonder how to create multi-level table headers, for example on this page ?

+6
source share
4 answers

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

There is a problem with Trac to change this setting for Vaadin 7. See https://vaadin.com/forum/-/message_boards/view_message/900369 for details.

Depending on your requirements, you can hide the header of the table component and try to simulate the header (using HorizontalLayout, creating your own headers and listening to column resize events); alternatively, you can simply create your own HTML <table></table> and assign it to the label component.

+4
source

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

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

It only remains to think that the column separator is not set to 100% of the height of the title bar ...

+1
source

Exploring a TreeTable Component May Help You: Vaadin sampler

Regards, Eric.

0
source

To create only the table header, use setPageLength (0); this will eliminate the body of the table and show only the title. Then create another table with a heading and your data and combine them into a layout :) This is a cool trick, be sure to match the ratio of the first heading to the second heading of the table.

0
source

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


All Articles