JavaFX 2 TableView Header Font Color

How to change the title text color of a TableView component?

I'm tired of this:

.table-view .column-header, .table-view .filler { -fx-text-fill: white; -fx-border-width: 0, 0; -fx-font-size: 12px; } 

Remove the border and also change the font size, but not the font color.

+4
source share
2 answers

Something like this might work.

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

@David Charles: TableColumn style classes also apply to the column heading, so you can use to create a separate column heading

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

and in java

 tableColumn.getStyleClass().add("foo"); 
+2
source

All Articles