Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Allow HTML content in Markdown cells #915

Description

@mjanschek

Context

dash                      1.20.0
dash-bootstrap-components 0.12.2
dash-core-components      1.16.0
dash-html-components      1.1.3 
dash-renderer             1.9.1 
dash-table                4.11.3

Describe the bug

I am not sure, if this is a bug or intended behaviour.
A Datatable column that presents Markdown can't render html snippets. In this case, I try to include an icon from the bootstrap font.

Expected behavior

A Data Table that present Markdown should be able to render html code, as it's encouraged by Markdown guidelines. If I directly edit the websites html, the icon can be displayed. So the font is included correctly.

Minimal example

app.py

import dash
import dash_table

bs_icons = {
    "href": "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css",
    "rel": "stylesheet",
    "crossorigin": "anonymous",
}

app = dash.Dash(__name__, external_stylesheets=[bs_icons])

app.layout = dash_table.DataTable(
    id='table',
    columns=[{"name": "Alarm", "id": "html", "presentation": "markdown"}],
    data=[{"html": '<i class="bi bi-alarm"></i>'}],
)

if __name__ == '__main__':
    app.run_server(debug=True)

Screenshots
Original Table
image
Edited Table (wanted result)
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions