Question

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.

Was it helpful?

Solution

Something like this might work.

.table-view .column-header .label {
    -fx-text-fill: white;
    -fx-font-weight: bold;
}

OTHER TIPS

@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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top