web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add left margin to chi...
Power Apps
Answered

Add left margin to child elements within vertical container

(0) ShareShare
ReportReport
Posted on by 7

Hello.

Is there a way to change the x axis value of certain child elements within vertical container?

I have a canvas app where I have series of question and text input laid out vertically. I want to put left margin on just the text inputs.

I want the effect of the second text input in this image, but I can only achieve it if I insert additional container around the text input and change the X value within there.

ss1.png

ss2.png

 

Is this the proper way to do it? Do I really need a container for every single text input just to have a left margin?

Thank you in advance.

Categories:
I have the same question (0)
  • SBax Profile Picture
    1,348 on at

    Adjust the "padding left" property of your controls

     

    This article explains padding in more detail 

     

    I quite often add a container within my containers that is 10 smaller than my actual container, which gives a margin around it

     

    In theory, either will work, just depends on the requirement

  • 290ch Profile Picture
    7 on at

    Thank you SBax. 

    My understanding is that padding left on the text input will only affect the text inside the input, and not the text input box itself. 

    Are you saying that I need that additional container around the text input (just like i have in the image attached) and set a padding on that? So essentially we need container for every single text input?

  • SBax Profile Picture
    1,348 on at

    For text input, I believe you are correct!

     

    I'm not at my desk at the moment, but when I am at home (around 30 mins time) I'll do you some screenshots of how I would tackle this

     

    Good news is, the way I have in mind does NOT require a container for each control

  • Verified answer
    SBax Profile Picture
    1,348 on at

    Hi again,

     

    Here is how I would tackle this

     

    Horizontal container 

    wrap property set to true

     

    text label of the appropriate width (e.g. Parent.Width)

    rectangle with width set to the the margin width you require (e.g. 10)

    text input of width textlabel.Width - rectangle.Width

     

    the end result looks like this:

    screenshot.png

     

     

    I have left the rectangle as blue to give you a clear understanding of what we have done, but you would set the fill on this to RGBA(255,255,255,0) 

     

    If this is something you are using a multiple times in your app, you could always explore a component instead, with an ouput property equalling the value of the text input

     

    hope this helps!

  • 290ch Profile Picture
    7 on at

    Thank you SBax, that is a much cleaner approach than messing with the x value.

    Will accept this as a solution.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard