在CSS(JavaFX)中设置表格视图的样式
如何在TableView中设置“THIS”点的样式 我的CSS代码如下所示:在CSS(JavaFX)中设置表格视图的样式,java,css,javafx,tableview,styling,Java,Css,Javafx,Tableview,Styling,如何在TableView中设置“THIS”点的样式 我的CSS代码如下所示: */* * Empty Stylesheet file. */ .root{ -fx-background-color: #262626; } .table-view{ -fx-background-color: transparent; } .table-view:focused{ -fx-background-color: transparent; } /* Spalten
*/*
* Empty Stylesheet file.
*/
.root{
-fx-background-color: #262626;
}
.table-view{
-fx-background-color: transparent;
}
.table-view:focused{
-fx-background-color: transparent;
}
/* Spaltenköpfe
Struktur column-header-background -> column-header */
.table-view .column-header-background{
-fx-background-color: linear-gradient(#131313 0%, #424141 100%);
}
.table-view .column-header-background .label{
-fx-background-color: transparent;
-fx-text-fill: white;
}
.table-view .column-header {
-fx-background-color: transparent;
}
.table-view .table-cell{
-fx-text-fill: white;
}
.table-row-cell{
-fx-background-color: -fx-table-cell-border-color, #616161;
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 0.0em; /* 0 */
}
.table-row-cell:odd{
-fx-background-color: -fx-table-cell-border-color, #424242;
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 0.0em; /* 0 */
}
.table-row-cell:selected {
-fx-background-color: #005797;
-fx-background-insets: 0;
-fx-background-radius: 1;
}
.table-view > .virtual-flow > .scroll-bar:vertical,
.table-view > .virtual-flow > .scroll-bar:vertical > .track,
.table-view > .virtual-flow > .scroll-bar:vertical > .track-background,
.table-view > .virtual-flow > .scroll-bar:horizontal,
.table-view > .virtual-flow > .scroll-bar:horizontal > .track,
.table-view > .virtual-flow > .scroll-bar:horizontal > .track-background {
-fx-background-color: transparent;
}
.table-view > .virtual-flow > .scroll-bar > .increment-button,
.table-view > .virtual-flow > .scroll-bar > .decrement-button {
-fx-opacity: 0;
}*
正如你所看到的,我已经改变了柱头的背景和诸如此类的一切。此外,我还更改了TableView的背景。所以我真的不知道我到底应该在CSS中更改什么。
谢谢你的帮助!:)
-GhostfaceChilla-.table view.filler是您要查找的选择器。对于分析一个组件来说,这个方法非常好
.table-view{
-fx-background-color: transparent;
}
如果TableView中没有记录,则背景色可以为白色。如果有人来这里搜索列显示隐藏按钮的CSS,那么为占位符设置样式可能会很好
.table-view .show-hide-columns-button {
-fx-background-color: red;
-fx-border-color: -fx-box-border;
-fx-border-insets: -1 -1 0 0;
}
我用CSS代码解决了这个问题:
.table-view .filler {
-fx-border-insets: 10 //Enter value depending on thickness;
}
试试这个
.table-view .filler{
-fx-background-color: transparent;
}
试试这个
.table-view .column-header-background
{
-fx-background-color: transparent;
}