删除tableView中的网格线 [英] Remove grid line in tableView
问题描述
我想使用css删除每个单元格的表格视图中的网格线。
I am trying to remove the grid line inside table view of each cell using css.
例如,在Name和Description列之间,有一条线,我假定它是网格线。我不知道使用css删除它。我可以在Java Swing中使用setShowGrid(false);但是这在javaFX中不可用。
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.
推荐答案
我假设你在问JavaFX 2.如果没有, :)
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;
}
或致电
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...
这篇关于删除tableView中的网格线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!