You can use the Markdown component that is included with Dash AG Grid to format and style text content in cells.
Dash uses the CommonMark specification of Markdown. Check out their 60 Second Markdown Tutorial if this is your first introduction to Markdown.
To reduce the risk of XSS attacks, the grid does not allow raw HTML by default. For more information, see this community forum post on writing secure Dash apps
Tip: It is also possible to safely render HTML using the cell renderer component.
The images in these examples are loaded from a remote source. The link is formatted like this:
"![alt text: sun](https://www.ag-grid.com/example-assets/weather/sun.png)"
They can also be loaded locally using:
f"![image alt text]({dash.get_asset_url('sun.png')})"
By default, links in Markdown format will open the link in the same tab. To open a link in
in a new tab, include {"linkTarget":"_blank"}
in the column definition.
In this example, dangerously_allow_code
is not enabled. As a result, raw HTML links do not render.
In this example, dangerously_allow_code=True
is enabled, allowing HTML to render within the Markdown component.