6

I have already tried the following code from Remove grid line in tableView , but that only allows me to change the vertical line colour and not the horizontal line colour.

So, I am trying to change the white border line colour which you can see in the image below, how would I change this colour? I am using JavaFX with CSS.

TableView

Here is my CSS:

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

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

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

.table-view .column-header-background .label{
    -fx-background-color: transparent;
    -fx-text-fill: #0ed9e0;
}

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

.table-view .table-cell{
    -fx-text-fill: #0ed9e0;
    -fx-alignment: center;
}

.table-row-cell{
    -fx-background-color: -fx-table-cell-border-color, #2b2a2a;
    -fx-background-insets: 0, 0 0 1 0;
    -fx-padding: 0.0em; /* 0 */
}

.table-row-cell:odd{
    -fx-background-color: -fx-table-cell-border-color, #262626;
    -fx-background-insets: 0, 0 0 1 0;
    -fx-padding: 0.0em; /* 0 */
}

.table-row-cell:selected {
    -fx-background-color: #005797;
    -fx-background-insets: 0;
    -fx-background-radius: 1;
}
Community
  • 1
  • 1
Milan
  • 763
  • 3
  • 10
  • 18
  • 1
    @Jan the question was edited by the OP after my comment to include the link I suggested. None the less it is no longer relevant and I’ll delete the comment. – Jonny Henly Jan 06 '22 at 17:07

1 Answers1

21

in order to change both vertical and horizontal color of borders you can use the following code in your css:

.table-row-cell{
-fx-border-color: red;
-fx-table-cell-border-color:red;}

Also, you can change the border of the whole table (not the inner borders) with the following code:

.table-view{
-fx-border-color: red;}
Petros
  • 550
  • 3
  • 13