How can I change the text color of the TableView component's header?
I tired this:
.table-view .column-header, .table-view .filler {
-fx-text-fill: white;
-fx-border-width: 0, 0;
-fx-font-size: 12px;
}
This remove the border, and also change the font size, but not the font color.
Something like this might work.
.table-view .column-header .label {
-fx-text-fill: white;
-fx-font-weight: bold;
}
@David Charles: style classes of the TableColumn also apply to the column header, so to style an individual column header, you can use
.table-view .column-header.foo .label {
-fx-text-fill: white;
-fx-font-weight: bold;
}
and in Java
tableColumn.getStyleClass().add("foo");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With