创建多行表头

发布于 2024-12-26 04:06:54 字数 188 浏览 3 评论 0原文

我有一个表,其中我的列标题设置为以下说明:

table.setColumnHeader

我想知道如何创建多级表标题,例如 在此页面

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦里人 2025-01-02 04:06:54

从 Vaadin 6.7.3 开始,使用库存 Vaadin 表组件目前无法实现此操作。

在 Vaadin 7 中更改此设置会引发 Trac 问题。请参阅 https://vaadin.com /forum/-/message_boards/view_message/900369 了解更多详情。

根据您的要求,您可以隐藏表格组件的标题并尝试模拟标题(通过使用 Horizo​​ntalLayout,生成您自己的标题并侦听列调整大小事件);或者,您可以简单地生成自己的 HTML 并将其分配给标签组件。

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.

娇俏 2025-01-02 04:06:54

在 Vaadin7 中,您可以通过在主题中添加以下 CSS 规则来动态设置表格标题高度:

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

唯一的想法是列分隔符未设置为标题行高度的 100% ...

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

影子是时光的心 2025-01-02 04:06:54

查看 TreeTable 组件可能会帮助您:
Vaadin 采样器

问候,
埃里克.

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

Regards,
Éric.

绿萝 2025-01-02 04:06:54

要仅设置表格的标题,请使用 setPageLength(0);这将消除表格主体并仅显示标题。
然后创建另一个带有标题和数据的表,并将这两个表组合在布局中:)
这是一个很酷的技巧,请确保第一个表头与第二个表头的比例相匹配。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文