Reputation: 2554
I'm styling a TableView. I set the border color to white (same as background color) so it is invisible. However, when the table is focused, the border becomes blue. I tried adding table-view:focused { -fx-border-color: white; }
to fix it, but it didn't help. How do I fix this?
I didn't add a screenshot because when I hit Print Screen
the Table loses focus.
Below is my full stylesheet, if it's relevant:
.table-view .column-header,
.table-view .column-header .filler,
.table-view .column-header-background .filler {
-fx-background-color: white;
-fx-border-width: 0;
}
.table-view .column-header {
-fx-font-size: 16px;
-fx-border-width: 0 0 1 0;
-fx-border-color: #efefef;
}
.table-view .column-header .label {
-fx-alignment: center_left;
-fx-font-size: 16pt;
-fx-padding: 5 0 15 0;
}
.table-row-cell,
.table-row-cell:odd {
-fx-background-color: white;
}
.table-row-cell:hover {
-fx-background-color: #efefef;
}
.table-row-cell:selected {
-fx-background-color: white;
-fx-text-fill: black;
}
.table-view .table-cell {
-fx-border-color: efefef;
-fx-border-width: 1 0 0 0;
-fx-font-size: 14px;
-fx-padding: 5 3 15 3;
}
.table-view {
-fx-border-color: white;
}
.table-view:focused .table-cell {
-fx-text-fill: black;
}
Upvotes: 0
Views: 1796
Reputation:
I solved the problem this way:
.table-view:focused {
-fx-background-color: -fx-box-border, -fx-control-inner-background;
-fx-background-insets: 0, 1;
}
I used for focused table-view the same declarations as for non focused one- see https://gist.github.com/maxd/63691840fc372f22f470#file-modena-css-L618
Upvotes: 1
Reputation: 94
the blue border added to your table should be removed if you use the outline css property and set it to none. So , here set the outline : none for your table when focused.
.table-view:focus {
outline: none;
}
Upvotes: 1