# Padding spaces in labels?

**URL:** <https://forum.inductiveautomation.com/t/padding-spaces-in-labels/58510>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [April 15, 2022, 8:39pm UTC](https://forum.inductiveautomation.com/t/padding-spaces-in-labels/58510 "2022-04-15T20:39:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [April 15, 2022, 8:39pm UTC](https://forum.inductiveautomation.com/t/padding-spaces-in-labels/58510/1 "2022-04-15T20:39:36Z")

</div>

This is probably an obvious question.

I have a label which is anchored at the center, with center alignment. I want to fill it with text like:

`Left<------------->Right`

Where “\<------------\>” represents multiple spaces. The trouble is that “something” is replacing all the multiple spaces with a single space (and even happened in this forum post)

So what magic do I need to insert into my label text in order to create spaces that don’t disappear?

I tried using multiple `&nbsp;`, but all that did was print out `&nbsp;` multiple times 🤣

---

<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:** [April 15, 2022, 8:50pm UTC](https://forum.inductiveautomation.com/t/padding-spaces-in-labels/58510/2 "2022-04-15T20:50:45Z")

</div>

![White-space pre](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6ec80276d20ecdafe423188ba9b181989438fdc1.png)

> **[CSS white-space property](https://www.w3schools.com/cssref/pr_text_white-space.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

What you are attempting may be a bad idea. It may not scale well if the user has different font settings, etc. Instead you should use two labels - one left justified and one right justified.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [April 15, 2022, 9:00pm UTC](https://forum.inductiveautomation.com/t/padding-spaces-in-labels/58510/3 "2022-04-15T21:00:53Z")

</div>

I’m aware of the potential problems, but this is really a special case for which I am willing to accept any issues
