Closed afonit closed 2 years ago
@afonit There is no way to render HTML inside a cell as we're using canvas rendering. With that said, most of the features HTML will give you such as adjusting color, background, font, weight and font-color can be achieved using the TextRenderer
object, for example:
renderer = TextRenderer(
background_color="moccasin",
text_color="blue",
font="bold 14px Arial, sans-serif",
)
In your screenshot above, only parts of the sentence are highlighted in bold or a different color - there isn't a way of doing that in ipydatagrid as of yet - it will need to be the entire string.
@ibdafna , thank you for the confirmation - that one cannot highlight parts of a sentence within a cell.
Currently one can use VegaExpr to format all text in a cell and/or the background color of a cell.
Is there an ability to render a cell as html?
Example: I do text search/analysis and return results from the dataset, currently I use pandas as the output as I can render html within text. This helps end users focus more quickly on the terms they were searching for in the returned results.
With pandas I can do:
Which looks like this:
Searching through the existing issues and looking through https://vega.github.io/vega/docs/expressions/ I am not seeing a mechanism to do this.
on an off chance I could pass the HTML function as an argument to the TextRenderer I tried
which of course did not work as it expects a color or VegaExpr.
Is there an ability or mechanism to render bolds and colors of text as I showed above in the screenshot?