# Centre aligned label text to bounding box

**URL:** <https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 9, 2016, 9:36am UTC](https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017 "2016-08-09T09:36:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 9, 2016, 9:36am UTC](https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017/1 "2016-08-09T09:36:24Z")

</div>

This might be a stupid question.. but I can't work out how to centre-align my labels. I have it working as per the Inductive University video for buttons, but the same HTML code doesn't work for labels.

In my Data.Text field of the label, I'm using:

```auto
<HTML><CENTER>Testing...
```

But all I get is the left aligned text "Testing..."

Is it possible to align label text? What about vertical alignment?

Thanks in advance.

Regards,

Nick

Edit:  
The alignment works sort of, but only if I have more than one line of text and it only aligns to the width of the longest line string..  
Is there any way to align it to the label bounding box?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 9, 2016, 10:35am UTC](https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017/2 "2016-08-09T10:35:24Z")

</div>

Hi Nick,

At the bottom of the properties panel, you’ll find the layout options.

---

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://forum.inductiveautomation.com/u/BryanB)\
**Post date:** [May 30, 2023, 6:53pm UTC](https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017/3 "2023-05-30T18:53:23Z")

</div>

Old post, but adding more information for the next person to Google this.

To do this dynamically in Vision, use a style customizer. Add a custom property to the label, and then use that to drive the property change. You can then bind the custom property to something else in your window.

For example (0=left, 1=center, etc.):

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/5/65b7be648febfed9b0d17c4bd589e23d7c6f05f5.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/78033c51d9410a3d133afe0b2e6b7a83846c30a1.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 31, 2023, 1:46am UTC](https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017/4 "2023-05-31T01:46:58Z")

</div>

I would pass in a string to make it easier. Otherwise you're having to remember what 0,1,2,3,4 are. Just pass in `left`, `right`, `center`, `leading`, or `trailing` or similar. (I actually never bothered to read what trailing and leading did 🤔)

You then might just be able to bind the string to the alignment property; I can't remember if this is an integer under the hood or a string

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 31, 2023, 1:48am UTC](https://forum.inductiveautomation.com/t/centre-aligned-label-text-to-bounding-box/12017/5 "2023-05-31T01:48:26Z")

</div>

> [@nminchin](#):
>
> trailing and leading

For when mixing text and icon.
