On this page:
This example shows how to use custom cell renderers to display HTML content in a cell.
This is a very powerful feature. Just remember to escape any HTML code that could be used for XSS attacks.
In the below configuration:
<script>
or other potentially malicious tags using the cell editor!safeHtmlRenderer
). This should be safe for user input, because only certain tags are allowed<img>
in the renderer
You can also put HTML into row and column headers.
If you need to attach events to DOM elements like the checkbox below, just remember to identify the element by class name, not by id. This is because row and column headers are duplicated in the DOM tree and id attribute must be unique.