前两个去除表格横竖线
.table-view .table-row-cell {
-fx-background-insets: 0;
}
.table-view .table-row-cell .table-cell {
-fx-border-width: 0px;
}
/**
*表格边框颜色
*/
.table-view *.column-header-background { /* FX theme stylesheet */
-fx-background-color: #5f93e7;
-fx-background-insets: 0px, 0px;
}
/**
* 表头背景颜色变化
*/
.table-column .label{
-fx-background-color: #5f93e7;
-fx-text-fill: white ;
-fx-text-alignment: center ;
-fx-graphic-text-gap:0;
}
/**
* 调节padding
*/
.table-column{
-fx-padding:0;
}
.table-view:row-selection .column-header-background .filler{
visibility: false;
-fx-background-color: #5f93e7;
}
本文介绍如何在JavaFX中自定义表格样式,包括去除表格的横竖线,以及设置表头的颜色,以实现更美观的界面效果。
944

被折叠的 条评论
为什么被折叠?



