ag-grid

How to render the HTML contained in the ag-grid cell data


I have some data that contains <p> paragraphs.

I created a custom cellRenderer that shows the data inside a <div> tag but the <p> and </p> show as text.

How can I make the <p> tags as HTML?


Solution

  • I found what will do it.

    <span dangerouslySetInnerHTML={{ __html: props.value }} />
    

    That why all tags in the cell data are treated as HTML rather then text

    Thank you.