# \[IGN-10679\]HTML on a Label

**URL:** <https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716>\
**Category:** Ignition\
**Created:** [August 15, 2024, 7:22pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716 "2024-08-15T19:22:10Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 7:22pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/1 "2024-08-15T19:22:10Z")

</div>

I'm trying to make part of a string bold using the label component. On the "Binding Preview" it seems to be working, but on browser it's not.

Any help there?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c1023a1a703a542d42c00824f4c5582fd3c1158b.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57418923a232e5801ce4128aba2240aa4e89d9d8.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 15, 2024, 7:26pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/2 "2024-08-15T19:26:47Z")

</div>

Don't use html in the string to accomplish this. Rather, use a style on the label.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 7:35pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/3 "2024-08-15T19:35:21Z")

</div>

I have to. I want to do something like this, without using two label components.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7ada05a2417425f633ce582eccd061e7ba7b75c5.png)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 15, 2024, 7:36pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/4 "2024-08-15T19:36:43Z")

</div>

Is using Markdown component an option, that may be easier to use.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 15, 2024, 7:43pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/5 "2024-08-15T19:43:32Z")

</div>

> [@Paulo\_Custodio](#):
>
> without using two label components.

Why? Personal goal?

Seriously this seems like an odd requierment.

The markdown component is the only (intended) way to do this with a single component that I am aware of.

Honestly though, for what you're doing (unless there is more you haven't explained), I would just use two labels, and then group them together if you want to be able to move them around together.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 7:50pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/6 "2024-08-15T19:50:34Z")

</div>

Thanks for the tip. I tried using Markdown, but is doing the same thing.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4d177ac3a9b4a3efd67707fff82d8acf970b6d9e.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed01cfeab695182a6be32cbef69a046e7e6e9c8d.png)  
am I missing something?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 15, 2024, 7:51pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/7 "2024-08-15T19:51:33Z")

</div>

Follow the doc

> **[Perspective - Markdown | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-markdown)**
>
> The Markdown component allows users to format any type of text so it is publishable as plain text.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 15, 2024, 7:52pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/8 "2024-08-15T19:52:20Z")

</div>

> [@Paulo\_Custodio](#):
>
> Am I missing something?

It uses the same markdown as this forum. Try,  
`Recipe: **Potato** `  
Result:  
Recipe: **Potato**

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 15, 2024, 7:53pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/9 "2024-08-15T19:53:14Z")

</div>

Either you need to use markdown, or you need to uncheck `props.markdown.escapeHtml`

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 7:53pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/10 "2024-08-15T19:53:22Z")

</div>

so, I dont want to use two labels for two reasons:  
I know it's possible to add the html to labels after reading this ([HTML in Ignition | Ignition User Manual](https://docs.inductiveautomation.com/docs/7.9/visualization-and-dashboards/understanding-components/html-in-ignition)) but I don't know what I'm doing wrong.

Another reason is that, I have some other labels that I can use this, that there's more than one word converted to bold. If I figure this out, I can apply that to other things, without adding a bunch of labels.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 15, 2024, 7:56pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/11 "2024-08-15T19:56:01Z")

</div>

> [@Paulo\_Custodio](#):
>
> I know it's possible to add the html to labels after reading this ([HTML in Ignition | Ignition User Manual](https://docs.inductiveautomation.com/docs/7.9/visualization-and-dashboards/understanding-components/html-in-ignition)) but I don't know what I'm doing wrong.

That is specific to the Vision Module, it does not apply to perspective, as the components in perspective are not Java Swing components.

> [@Paulo\_Custodio](#):
>
> that there's more than one word converted to bold

Only options without getting crazy are:

1. Use multiple labels
2. Use the markdown component in these cases.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/12 "2024-08-15T20:01:05Z")

</div>

After unchecking the _escapeHtml_ it worked. Thank you guys!!!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 15, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/13 "2024-08-15T20:17:07Z")

</div>

> [@Paulo\_Custodio](#):
>
> I don't know what I'm doing wrong.

First thing, make sure you're reading the manual for the version of the software you're actually using:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6e367dba3758b287d1b6160682148d51a94222e3.png)

Second thing, you really shouldn't use HTML/the `escapeHTML` property for this. It's just as easy to write an expression to output `Recipe: **Potato** ` as it is to output the HTML, and it's a whole lot easier to read. You're also guaranteed to be in a sane subset of text formatting operations, rather than opening the door to literally any HTML.

> [@Paulo\_Custodio](#):
>
> I have some other labels that I can use this, that there's more than one word converted to bold.

Last main thing - it may or may not even be a good idea to do this text formatting inline at all. A repeated stack of `X: Y` relationships might be better represented with a _table_, and it's trivially easy to format each column in a table differently.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 15, 2024, 8:19pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/14 "2024-08-15T20:19:39Z")

</div>

> [@Paulo\_Custodio](#):
>
> On the "Binding Preview" it seems to be working, but on browser it's not.

This is just a bug, by the way, and I've filed a ticket to get it fixed.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 8:22pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/15 "2024-08-15T20:22:07Z")

</div>

I'll try that.

Thank you very much, I'll keep that in mind!

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [August 15, 2024, 8:29pm UTC](https://forum.inductiveautomation.com/t/ign-10679-html-on-a-label/94716/16 "2024-08-15T20:29:27Z")

</div>

I reconsidered, and tried this, and it worked as well. Thanks you!
