Can anyone point me to an example that puts rich t...
# tornadofx
k
Can anyone point me to an example that puts rich text in a table cell? I want to put a phrase in the cell and make certain things in that phrase bold or italic.
g
TextFlow might help (sorry I don't have an example handy)
a
Grant is right. You need different Label/Text to format them differently.
You can also use a FlowPane and add Labels to it
k
@abhinay You mean, "don't use a table" or "put a FlowPane in the cell"?
a
Put a FlowPane as the cell graphic
k
Thanks, will give it a try
What about a web view?
a
What about webview?
g
I have used both.
a
@kastork If you meant using a WebView for each Cell, I wouldn't go down that path.
k
Could you put a web view in a cell?
... then you could style the text by making it markup
a
sure, you can. although, I am skeptic if its the right idea to show multiple webviews in a single TableView. Can turn out be a huge bottleneck. This can be easily taken care by a custom cell with a TextFlow/FlowPane. If you have a MCVE, I can most probably wire it with a custom TextFlow for you.
k
I appreciate the offer. But I'd rather work it out myself so I learn it. I appreciate the pointer on where to start.
a
👍
g
I agree that a webview is not the preferred approach but if you want to display html then you don't have a choice
I have also found that using Text in a cell is an easy way to get wrapping/ multiline text (without formatting)