# Help with \`button\` node, \`text\` node and formatting text in them

**URL:** <https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657>\
**Category:** Dashboard\
**Created:** [18 September 2019 11:52 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657 "2019-09-18T11:52:08Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [19 September 2019 09:16 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/21 "2019-09-19T09:16:38Z")

</div>

Thanks @dceejay.

(Just saw the edit come in. Thanks.)

That may be the solution.

I know I should know that, but there are limits to what I can remember and when.

On the last bit:  
_but the label just thinks it is text so aligns it as if it was just a font on the same line - so the base of the "letters" line up. - If you didn't have the fa-2x then they line up ok - but because you are adding a large"letter" it will stand out on top._

Ok. But. . . . (thinking) In the `text` node, the `99` is the name of the node.  
The `bullseye` is the `msg.payload`. They are treated separately.  
Which is why they look different when I see the two. (Hmmm.)

Slightly off topic - well not really - how would I make all the stuff _bigger_?  
So the `99` and the `bullseye` are both big?

I know I can't do a `fa-2x` around them all. (or can I?)  
What is the alternative?  
Just asking.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 September 2019 09:37 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/22 "2019-09-19T09:37:15Z")

</div>

Well you can add the text in with the icon

```auto
[{"id":"32cecccc.68f9a4","type":"ui_button","z":"3658255b.2041aa","name":"","group":"1e4b8483.ea6fab","order":7,"width":0,"height":0,"passthru":false,"label":"{{msg.payload}}","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":750,"y":220,"wires":[[]]},{"id":"b5e3b1d0.c5e7a","type":"inject","z":"3658255b.2041aa","name":"","topic":"","payload":"<font color=\"lime\" size=\"+2\" class=\"fa fa-bullseye fa-2x\">&nbsp;&nbsp;99</font>","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":220,"wires":[["32cecccc.68f9a4"]]},{"id":"1e4b8483.ea6fab","type":"ui_group","z":"","name":"LED Example","tab":"28e3359c.db4eaa","order":1,"disp":true,"width":"6","collapse":false},{"id":"28e3359c.db4eaa","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

Meanwhile I will improve the alignment of text and icon.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [19 September 2019 09:41 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/23 "2019-09-19T09:41:20Z")

</div>

The alignment part:  
That's for the `button` node - yes?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 September 2019 09:45 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/24 "2019-09-19T09:45:02Z")

</div>

yes - that is what we are talking about.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [19 September 2019 09:46 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/25 "2019-09-19T09:46:00Z")

</div>

Sorry. I didn't want to be rude.  
I just wanted to check.

And again: Thanks.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [21 September 2019 01:39 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/26 "2019-09-21T01:39:19Z")

</div>

I've made a bit of progress.

In the `button` node I have this:

```auto
<font size ="4">83</font>&nbsp;&nbsp;&nbsp;{{msg.payload}}

```

Which gets the numbers (83) to the right size.

But now the {{msg.payload}} needs a bit of work.

This is the payload:

```auto
msg1 = {payload: '<font color = "red" i class="material-icons md-58">error</i>'};

```

But the `md-58` (or any other size) doesn't seem to bare much on the size of the icon.

Is that because it is overwritten by the initial `size` in the `button` node?

I shall try a couple more things, but am not really getting anywhere.

I have a similar set up on another `button`, but it uses `fa-` icons.

I can set the size of the text in one part and the size of the icon in another.

Shall do more digging.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [21 September 2019 01:52 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/27 "2019-09-21T01:52:42Z")

</div>

Seems if I use the `font-awesome` icon which is the same _look_ as the one I mentioned, I can _fude_ it to work how I did it with the other `button`.

This is a kind of solution.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [21 September 2019 05:35 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/28 "2019-09-21T05:35:19Z")

</div>

Check the `payload`, `font` and `i` tag are not correct html.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 September 2019 08:16 UTC](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657/29 "2019-09-21T08:16:56Z")

</div>

> [@Trying\_to\_learn](#):
>
> Ok, so code fixed.

From this same thread... Scroll up to see what it should be.

[Previous page](https://discourse.nodered.org/t/help-with-button-node-text-node-and-formatting-text-in-them/15657.md?page=1)
