# How to add HTML Code in Grafana 7

**URL:** <https://community.grafana.com/t/how-to-add-html-code-in-grafana-7/47503>\
**Category:** Grafana\
**Created:** [May 13, 2021, 10:25am UTC](https://community.grafana.com/t/how-to-add-html-code-in-grafana-7/47503 "2021-05-13T10:25:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barryaljawari](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/barryaljawari/32/14375_2.png) [@barryaljawari](https://community.grafana.com/u/barryaljawari)\
**Post date:** [May 13, 2021, 10:25am UTC](https://community.grafana.com/t/how-to-add-html-code-in-grafana-7/47503/1 "2021-05-13T10:25:29Z")

</div>

Hello guys!

I have been having trouble upgrading from Grafana 6 to 7! I have currently trying to upgrade to the newer version and I did come up with some issues where I am not able to display any HTML anymore. See the attached image:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/4/d/4d129206e22a79ac08415e5f01c82cadffbe935a.png)

```
<center>
<br />
<table style="border: none;">
    <tr style="border: none;">
        <td style="border: none;">
            <select id="kw-type" name="kw-type" class="btn navbar-button gf-timepicker-nav-btn" style="width: 130px;">
                <option value="positive">POSITIVE</option>
                <option value="negative">NEGATIVE</option>
            </select>
        </td>
        <td style="border: none;">
            <input type="text" id="kw-keyword" name="kw-keyword" class="btn navbar-button gf-timepicker-nav-btn" style="text-align: left;" />
        </td>
    </tr>
    <tr>
        <td colspan="2" style="border: none; text-align: center;">
            <center>
                <button
                    onclick="insertKeywords(1,document.getElementById('kw-type').value,document.getElementById('kw-keyword').value,'popup','refresh');document.getElementById('kw-keyword').value=''"
                    class="btn navbar-button gf-timepicker-nav-btn"
                >
                    Add to watchlist
                </button>
            </center>
        </td>
    </tr>
</table>
</center>

```

and it worked fine when I had it in Grafana 6 but now as you can see it only displays the code now.

I wonder how I can add HTML Code in grafana like I had it in 6 before 😢

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [June 15, 2021, 10:03pm UTC](https://community.grafana.com/t/how-to-add-html-code-in-grafana-7/47503/2 "2021-06-15T22:03:10Z")

</div>

Hi @barryaljawari

This still works. Here is your html code on my local instance running Grafana 8.0.2:

 ![CleanShot 2021-06-15 at 11.59.54@2x](https://us1.discourse-cdn.com/grafana/original/3X/2/2/220731f49963edeeca19c2cc2816ce0b08f2fedc.png)

There was a lot of [work done on the Text Panel](https://github.com/grafana/grafana/pull/26413) between Grafana 6 and 7.

Have you set `disable_sanitize_html` to `true` in your configurations? You need to do that starting with v7:

`docker run -d -p 3000:3000 "GF_PANELS_DISABLE_SANITIZE_HTML=true" grafana/grafana:8.0.2 `

> **[Configure Grafana | Grafana documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/)**
>
> Configuration documentation

**NOTE** :

The default is `false` because this setting leaves you more exposed to XSS attacks (see PR for larger discussion)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [May 13, 2022, 10:25am UTC](https://community.grafana.com/t/how-to-add-html-code-in-grafana-7/47503/3 "2022-05-13T10:25:58Z")

</div>

This topic was automatically closed after 365 days. New replies are no longer allowed.
