# Perspective button text new line

**URL:** <https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [July 9, 2021, 10:35am UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649 "2021-07-09T10:35:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [July 9, 2021, 10:35am UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/1 "2021-07-09T10:35:16Z")

</div>

Hi,  
I’m trying to tell Ignition to go to a new line in a Button text but it seems that both the HTML   
 tag and \n\n don’t work as you can see from my attempts  
 ![Perspective button new line 1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/380b13b3e396780faa0430ce27aaeee2332b862d.jpeg) ![Perspective button new line 2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/b/fbf2d3df7d53fb0d3e15e63b8fe5f1cd178a09e4.jpeg)  
Does anyone know how to do it?  
Thanks

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 9, 2021, 11:41am UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/2 "2021-07-09T11:41:42Z")

</div>

oke so

add in the style:

```auto
white-space: pre-wrap

```

and then you will have to fiddle with the text input a bit untill you get this (add in a long string and lose focus):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/34016ee354fcb751d687a76411edbf390f16f19d.png)

then you can add in enters as you wish:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/9/e91273fae21055adfa4d65ab3e68e64ec35e2a3b.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44ab0a10ad653bdffc776f09307c7f79b5b5c7af.png)

---

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [July 9, 2021, 12:47pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/3 "2021-07-09T12:47:47Z")

</div>

Thanks, initially it didn’t worked because the button text is binded to an expression so I just can’t type directly in the property. But by appliyng the pre-wrap style and incresing a bit the font size it worked out.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 9, 2021, 12:49pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/4 "2021-07-09T12:49:49Z")

</div>

you can do it in a script too if you use triple “”"  
idk if that works in expressions tho  
`""" test test test """`

---

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [July 9, 2021, 12:58pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/5 "2021-07-09T12:58:16Z")

</div>

It doesn’t seem to work, this is an example of the expression I’m using  
`if(tag("[default]tagDirectory/tag")=1,'"""line 1 line2"""','"""line1 line2"""')`

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 9, 2021, 1:01pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/6 "2021-07-09T13:01:57Z")

</div>

yeah i thought so  
so you can add just the tag in the exprions (or just a direct tag link)  
and then use the value in a script transform with the if logic

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d852a9b05707f8726fdf249c42de1b883c76ca4a.png)  
(seems like you have to remove the tabs tho else it indents)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b3ef95cb69a731f2e599119698aa4b16a2ee7d1f.png)

---

<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:** [July 9, 2021, 2:54pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/7 "2021-07-09T14:54:12Z")

</div>

> [@victordcq](#):
>
> and then you will have to fiddle with the text input a bit untill you get this (add in a long string and lose focus):

Easier option is to use expressions, where the literal `\n` won't be escaped, e.g.:  
`"line1\nline2\nline3"`  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/6401919e38f3d22df88c231e63bca3b553ce691e.png)  
(You'll still want the white-space setting applied, though)

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [February 17, 2022, 2:36pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/8 "2022-02-17T14:36:18Z")

</div>

setting style white-space to pre-wrap worked for me …thanks

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [February 17, 2022, 2:37pm UTC](https://forum.inductiveautomation.com/t/perspective-button-text-new-line/48649/9 "2022-02-17T14:37:42Z")

</div>

yeah it works but only if style attribute whitespace is set to pre-wrap 👍 👍
