Creating multirow table headers

2020-03-03 05:25发布

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?

标签: vaadin
4条回答
我欲成王,谁敢阻挡
2楼-- · 2020-03-03 05:34

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 ...

查看更多
贼婆χ
3楼-- · 2020-03-03 05:37

A look into the TreeTable component may help you : Vaadin sampler

Regards, Éric.

查看更多
仙女界的扛把子
4楼-- · 2020-03-03 05:43

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.

查看更多
够拽才男人
5楼-- · 2020-03-03 05:50

To make a header only of a table use setPageLength(0); this will eliminate the table body and show only the header. Then create another table with a header and your data and combine these 2 in a layout :) It's a cool trick, be sure to match the ratio's of first header with the second's table header.

查看更多
登录 后发表回答