0

I have .css when the row is selected which is fine.

row when clicked

However when I click off the row it changes the row color grey with a black font, is there any way to edit this css?

row when clicked off

.table-view {
    -fx-base: transparent;
    -fx-control-inner-background: transparent;
    -fx-background-color: #507CA6;
    -fx-padding: 5;
}

.table-view .column-header-background {
    -fx-background-color: transparent;
}

.table-view .column-header, .table-view .filler {
    -fx-size: 35;
    -fx-border-width: 0 0 1 0;
    -fx-background-color: transparent;
    -fx-border-color: #B4D9FD;
    -fx-border-insets: 0 10 1 0;
}

.table-view .column-header .label {
    -fx-font-size: 14pt;
    -fx-font-family: "Segoe UI Light";
    -fx-text-fill: white;
    -fx-alignment: center-left; 
    -fx-opacity: 1;
}

.table-view:focused .table-row-cell:filled:focused:selected {
    -fx-background-color: #273D51;
}

Any help would be appreciated.

Uluk Biy
  • 48,655
  • 13
  • 146
  • 153
Davidaj
  • 235
  • 3
  • 14

2 Answers2

4

Try this:

/* When control is selected but not focused */
.table-row-cell:filled:selected,
.table-row-cell:filled > .table-cell:selected {
    -fx-background: red;
}
Uluk Biy
  • 48,655
  • 13
  • 146
  • 153
1

first make selected class than use this script, i always use this $("tr").click(function(){ $(this).addClass("selected").siblings().removeClass("selected"); });​

UI-UX
  • 262
  • 1
  • 9