# Formatting Label text in an expression

**URL:** <https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173>\
**Category:** Ignition\
**Created:** [October 30, 2020, 2:58pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173 "2020-10-30T14:58:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven.cox](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.cox/32/18589_2.png) [@steven.cox](https://forum.inductiveautomation.com/u/steven.cox)\
**Post date:** [October 30, 2020, 2:58pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173/1 "2020-10-30T14:58:41Z")

</div>

Hi all,

Once again I am trying something new and need some direction. I have a label that I setup this expression for…

```auto
concat("The Selected Binder is ", {Root Container.Label 2.selectedBinderName})

```

It works fine, but I would like to be able to make the two different strings a different font.

Where should I look for this?

Thanks, Steven

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [October 30, 2020, 3:28pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173/2 "2020-10-30T15:28:53Z")

</div>

The labels work with HTML formatting. Have you tried adding that into your string to set your font for the different sections?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [October 30, 2020, 3:41pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173/3 "2020-10-30T15:41:22Z")

</div>

You can use a selection of HTML markup tags for formatting text.  
The font tag is limited though, you can only set bold,color and size I believe.

[https://docs.inductiveautomation.com/display/DOC79/HTML+in+Ignition](https://docs.inductiveautomation.com/display/DOC79/HTML+in+Ignition)

---

<div class="post-metadata">

**Author:** ![steven.cox](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.cox/32/18589_2.png) [@steven.cox](https://forum.inductiveautomation.com/u/steven.cox)\
**Post date:** [October 30, 2020, 6:29pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173/4 "2020-10-30T18:29:20Z")

</div>

@bpreston & @MMaynard

> [@bpreston](#):
>
> The labels work with HTML formatting. Have you tried adding that into your string to set your font for the different sections?

I am binding properties to the label in a Property Expression.

The Expression is this...

```auto
concat("The current Binder is ",{Root Container.Power Table.selectedBinderName} ,"The current Topic is ",{Root Container.Label 2.selectedTopicName})

```

When I try to put html here...

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

It looks great in design mode. But when I go to preview or the client, it does not see the html formatting.

When I try to put it in the Expression, it does not like it.

What am I missing?

Thanks, Steven

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [October 30, 2020, 6:43pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173/5 "2020-10-30T18:43:40Z")

</div>

```auto
concat("<html>","The current Binder is ",{Root Container.Power Table.selectedBinderName} ,"<font color='red'><b>","The current Topic is ",{Root Container.Label 2.selectedTopicName},"</b></font></html>")

```

---

<div class="post-metadata">

**Author:** ![steven.cox](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.cox/32/18589_2.png) [@steven.cox](https://forum.inductiveautomation.com/u/steven.cox)\
**Post date:** [October 30, 2020, 6:53pm UTC](https://forum.inductiveautomation.com/t/formatting-label-text-in-an-expression/40173/6 "2020-10-30T18:53:10Z")

</div>

Ah, I see the html formats the entire string not each string separately.

```auto
concat("<html>The current Binder is <b>", {Root Container.Power Table.selectedBinderName}, "<br></b>The current Topic is <b>", {Root Container.Label 2.selectedTopicName})

```

So this gives me bold and line break right where I want it.

Thanks for the help!!

Steven
