Remove grid line in tableView
Asked Answered
I

2

4

I am trying to remove the grid line inside table view of each cell using css. enter image description here

For example, between the Name and Description column, there is a line which I assumed that it is grid line. I have no idea to remove it using css. I can do it in Java Swing using setShowGrid(false); but this does not available in javaFX.

Important answered 1/7, 2013 at 11:52 Comment(0)
T
14

I assume you're asking about JavaFX 2. If not, I suggest you upgrade :)

Try putting this in your stylesheet:

.table-view {
  -fx-table-cell-border-color: transparent;
}

Or call

tableObject.setStyle("-fx-table-cell-border-color: transparent;")

In order to keep horizontal lines, I had to do the following

.table-view .table-row-cell {
  -fx-border-width: 1;
}

There's probably a better way to do this, but this worked for me...

Tendinous answered 18/7, 2013 at 20:33 Comment(2)
But do you know how to hide the table header?Important
It works for the nominal case, but I still have the lines for the selected rows (focused or not).Coolidge
F
1

to remove grid line in tableView what @kylejmcintyre said is true.

to hide the table header do this:

.column-header-background { visibility: hidden; -fx-padding: -1em; }
Farland answered 29/12, 2014 at 10:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.