我对 JavaFX 和 CSS 样式(以及 stackoverflow)相当陌生。我想知道如何设计列的表格标题。 这是我的标题目前的样子: Current styling of my table view column header
这就是我想要的样子: Styling I want to implement
我尝试应用以下 CSS 样式但无济于事:
.table-view .column-header .nested-column-header
{
-fx-background-color: #AAAAAA;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.6), 2, 0.5, 1, 1);
}
.table-view .column-header
{
-fx-background-color: #AAAAAA;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.6), 2, 0.5, 1, 1);
}
.table-view .column-header .filter
{
-fx-background-color: #AAAAAA;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.6), 2, 0.5, 1, 1);
}
我还检查了在 jfxrt.jar 中找到的 caspian.css 文件,但这无法为我指明正确的方向。
因此,如果有人有任何想法,那就太好了。 :) 在此先感谢您。
最佳答案
我建议尝试使用以下样式类:
.table-view .column-header-background
我用这个 css 改变了我的列标题背景并且它起作用了:
.table-view .column-header,
.table-view .column-header .filler,
.table-view .column-header-background .filler {
-fx-background-color: red;
}
你确定你没有树 table 吗?因为样式类被命名为 tree-table-view
而不是 table-view
。
关于css - 如何使用 CSS 设置 Java FX TableView 列标题的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36687314/