# Label margin/padding inside its border?

**URL:** <https://forum.inductiveautomation.com/t/label-margin-padding-inside-its-border/11160>\
**Category:** Ignition\
**Created:** [February 2, 2016, 5:28pm UTC](https://forum.inductiveautomation.com/t/label-margin-padding-inside-its-border/11160 "2016-02-02T17:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kraenbring](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@Kraenbring](https://forum.inductiveautomation.com/u/Kraenbring)\
**Post date:** [February 2, 2016, 5:28pm UTC](https://forum.inductiveautomation.com/t/label-margin-padding-inside-its-border/11160/1 "2016-02-02T17:28:45Z")

</div>

I have a left-aligned label with some text, a white background and a black line border.  
[http://screencast.com/t/kPfbNz1kux](http://screencast.com/t/kPfbNz1kux)

The text is pretty close to the border, making it a little harder to read. Is there a way to change the margin or padding of the label? In other areas, I’ve centered my label to make it look better, but in this case I need it left-aligned.

I know I can create a template with a rectangle and a label to achieve the same effect or turn my text into an expression and append a space on the front. I’m looking for something less cumbersome (more like a setting that I’m apparently not able to see) 🙂

Thoughts?

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [February 2, 2016, 9:09pm UTC](https://forum.inductiveautomation.com/t/label-margin-padding-inside-its-border/11160/2 "2016-02-02T21:09:02Z")

</div>

Hello,  
You could put the following code in the propertyChange script of the label:

`
if event.propertyName == "componentRunning":
	from javax.swing import BorderFactory
	label = event.source
	paddingBorder = BorderFactory.createEmptyBorder(0,5,0,0)
	border = BorderFactory.createCompoundBorder(label.border,paddingBorder)
	label.border = border
`Note that you will only see the results of this code in a client and not in a designer because this code only runs in a client.

Best,
