Line wrap in entry table

I have copied the original CSS. I am trying to figure out where in the file to put the overflow-wrap property, which I think is supposed to be -fx-wrap-text. Maybe in the .table-cell section?

The previous topic showed this

.table-view .cell{
	 -fx-cell-size: 100; //default is 24
}

I think this is the section of interest where I might add -fx-wrap-text: true

.table-cell,
.tree-table-cell,
.table-cell .glyph-icon,
.tree-table-cell .glyph-icon {
-fx-padding: 0.5em 1em 0.5em 1em;
-fx-cell-size: 4.0em;
-fx-text-fill: -fx-text-background-color;
-fx-fill: -fx-text-background-color;
}

Messing around with Scenic View is something that would have to wait for another time.

Edit above: incorrect guess. table-view not table-cell

Solution

I added the .table-view section according to the previous instructions, plus the wrapping property. The location of this addition to the default theme does not matter as this new properties do not conflict with any existing styles.

.table-view .cell{
    -fx-cell-size: 100;
    -fx-wrap-text: true
}

Success!

Also works with em and adapts as expected with changes in font size. A value of 5.6 was the first .1 increment that fit three lines per row

.table-view .cell{
    -fx-cell-size: 5.6em;
    -fx-wrap-text: true
}

2 Likes