Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styling a TableView in CSS (JavaFX)

How can I style the "THIS" point in my TableView?

TableView

My CSS Code looks as follows:

   */*  * Empty Stylesheet file.  */  .root{     -fx-background-color: #262626; }  .table-view{    -fx-background-color: transparent; }  .table-view:focused{     -fx-background-color: transparent; }  /* Spaltenköpfe     Struktur column-header-background -> column-header */  .table-view .column-header-background{     -fx-background-color: linear-gradient(#131313 0%, #424141 100%); }  .table-view .column-header-background .label{     -fx-background-color: transparent;     -fx-text-fill: white; }  .table-view .column-header {     -fx-background-color: transparent; }  .table-view .table-cell{     -fx-text-fill: white; }  .table-row-cell{     -fx-background-color: -fx-table-cell-border-color, #616161;     -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, #424242;     -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; }  .table-view > .virtual-flow > .scroll-bar:vertical, .table-view > .virtual-flow > .scroll-bar:vertical > .track, .table-view > .virtual-flow > .scroll-bar:vertical > .track-background,  .table-view > .virtual-flow > .scroll-bar:horizontal, .table-view > .virtual-flow > .scroll-bar:horizontal > .track, .table-view > .virtual-flow > .scroll-bar:horizontal > .track-background {     -fx-background-color: transparent; }    .table-view > .virtual-flow > .scroll-bar > .increment-button,  .table-view > .virtual-flow > .scroll-bar > .decrement-button {     -fx-opacity: 0; }* 

So as you can see I've already changed the colum-header-background and everything like this. Also I#ve changed the background of the TableView. So I really don't know what exactly I should change in my CSS. Thanks for every help! :)

-GhostfaceChilla-

like image 724
Chris Avatar asked Nov 26 '15 12:11

Chris


People also ask

Can CSS be used in JavaFX?

CSS styles are applied to nodes in the JavaFX scene graph in a way similar to the way CSS styles are applied to elements in the HTML DOM. Styles are first applied to the parent, then to its children.

What is TableView in JavaFX?

The TableView class provides built-in capabilities to sort data in columns. Users can alter the order of data by clicking column headers. The first click enables the ascending sorting order, the second click enables descending sorting order, and the third click disables sorting. By default, no sorting is applied.

How do I filter a TableView?

We can filter TableView content in two main ways – manually, or by using the FilteredList class JavaFX provides. In either case, we can update our search criteria by placing a ChangeListener on the search box TextField. This way, each time the user changes their search, the TableView is updated automatically.


1 Answers

.table-view .filler is the selector you are looking for. The scenic view tool is pretty good for analyzing a component.

like image 132
wzberger Avatar answered Sep 19 '22 15:09

wzberger