制表符 - 在同一页面上使用多个 table 主题
Tabulator - Using multiple table themes on the same page
我可以看到您可以为制表符表设置主题,从它说明的文档中可以看出
“要使用其中一个,只需包含匹配的 CSS 文件而不是默认的 tabulator.css”
如果我想拥有 3 个不同主题的桌子怎么办?
我知道这是可能的,因为 documentation page 做到了,但我看不出怎么做。任何指导将不胜感激
这是不可能开箱即用的,因为每个主题的 CSS 都对 table 元素使用相同的 CSS 选择器,因此它们都会努力为每个 tables.
我也会质疑为什么这是必要的,一般来说,将 table 多个主题放在同一页面上会给您的用户带来相当不和谐的体验,我不推荐这样做。
也就是说,示例页面通过更新每个主题的样式表来查找特定的 table id 而不是通用的 .tabulator
选择器来实现这一点。
所以样式表中引用 .tabulator
的任何地方:
.tabulator .tabulator-header.tabulator-header-hidden {
例如变成:
#bulma-theme-table .tabulator-header.tabulator-header-hidden {
稍后您还需要在样式表中为通用选择器添加前缀,例如:
.tabulator-row.tabulator-moving {
会变成:
#bulma-theme-table .tabulator-row.tabulator-moving {
我可以看到您可以为制表符表设置主题,从它说明的文档中可以看出
“要使用其中一个,只需包含匹配的 CSS 文件而不是默认的 tabulator.css”
如果我想拥有 3 个不同主题的桌子怎么办?
我知道这是可能的,因为 documentation page 做到了,但我看不出怎么做。任何指导将不胜感激
这是不可能开箱即用的,因为每个主题的 CSS 都对 table 元素使用相同的 CSS 选择器,因此它们都会努力为每个 tables.
我也会质疑为什么这是必要的,一般来说,将 table 多个主题放在同一页面上会给您的用户带来相当不和谐的体验,我不推荐这样做。
也就是说,示例页面通过更新每个主题的样式表来查找特定的 table id 而不是通用的 .tabulator
选择器来实现这一点。
所以样式表中引用 .tabulator
的任何地方:
.tabulator .tabulator-header.tabulator-header-hidden {
例如变成:
#bulma-theme-table .tabulator-header.tabulator-header-hidden {
稍后您还需要在样式表中为通用选择器添加前缀,例如:
.tabulator-row.tabulator-moving {
会变成:
#bulma-theme-table .tabulator-row.tabulator-moving {