How do I change the border lines COLOUR on the table view


Tags: java,css,javafx

Problem :

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;
}


Solution :

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;}

    CSS Howto..

    CSS stylesheets at top or bottom? or How to solve blank page issue?

    How to get dimensions for a background image when background-size is set to contain?

    Wordpress- How do i change the default font of navigation menu?

    How do I repeat select elements in HTML

    HOW to combine two element that has different parent in CSS? [duplicate]

    How to make a div box with display:flex clickable like display:block?

    Html, CSS - How to create a donut chart like this?

    How to achieve this layout with CSS and div?

    How to set the target images that should go uner this code

    How can I make the parent div draggable

    How to handle Chrome rendering dynamically added elements with incomplete CSS

    How to make an element with fixed position relative to its parent, not the whole screen?

    how to fix height:auto css

    How can I make a rounded image with a label in it?

    Hide all div element but show first two

    how to interactively toggle CSS sheets(s) on a webpage for testing/learning purposes?

    How do I find space between lines in HTML?

    how to animate icon fa-circle using CSS to look as recording video blinking red dot?

    Pure.css 1-3 grid only shows 2 items per line

    How to swap class / id using jquery in a css list?

    How to set color of the Button with jQuery UI?

    How to fix element on the center of scrollable page?

    How to have background-image and gradient background-color work on one selector in CSS?

    How can I have the text content of a div overflow in a HTML email template?

    How to apply style rules that are tied to a model in AngularJS?

    With media queries, how to prevent the browser from downloading a smaller background-image if a larger image has already been downloaded?

    How to Make Text Black on .mouseover

    How to remove some css properties using regular expression?

    css: how to vertically align table within div

    How to force Dojo TitlePane to overlap with CSS?