使用 Tabulator 设置最大桌子高度 [英] Setting maximum table height with Tabulator

查看:30
本文介绍了使用 Tabulator 设置最大桌子高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tabulator 库似乎支持两种设置表格高度的模式:一个显式值(如果数据集中没有足够的行,它会在底部强制一个灰色"区域;如果行数太多,则使用垂直滚动条许多行),或自动模式(调整高度以适应实际数据,不创建滚动条).

The Tabulator library seems to support two modes for setting the table's height: an explicit value (which forces a "gray" area at the bottom if there are not enough rows in the data set; and a vertical scrollbar if their are too many rows), or an automatic mode (the height is adjusted to fit the actual data, no scrollbar is created).

可以使用最大高度,以便在需要时出现垂直滚动条,否则高度会根据内容进行调整?

It is possible to use a maximum height, so that a vertical scrollbar appears if needed, but otherwise the height is adjusted to the content?

推荐答案

没有任何关于此的真正记录.但是我发现为 .tabulator-tableHolder 类分配一个 max-height 可以完成工作.

There is nothing really documented about this. However I found that assigning a max-height to the .tabulator-tableHolder class gets the job done.

.tabulator-tableHolder {
  max-height: 100px !important;
}

请注意,这会禁用虚拟 DOM,如果您有很多行,这将影响性能.

Please note that this disables the virtual DOM, which will be a performance hit if you have many rows.

这篇关于使用 Tabulator 设置最大桌子高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆