cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AsgeirAlbretsen
Level: Powered On

How can I center gallery items in a gallery?

I have a gallery which is sorted based on a text input field. The gallery looks just fine when there are many items filling it, but when there are just a few items, the gallery doesn't look centralized. How can I make sure the items are always centralized? I don't want to items to be outside the screen on the left side, only the right side. Basically how it is now, except centralizing when there are few items.

 

Here is an image showing how it looks with few items. I would want these to be centralized. (333334 in the middle)

 

main_page.png

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How can I center gallery items in a gallery?

If you want it always centered just drag the data to that spot in the gallery and it will stay there.

 

If you want it centered only when certain criteria are met you can use an If statement on the X value for each label and text input...something like:

 

You will need a label outside the gallery that is = CountRows(Gallery1.AllItems)

 

On label in Gallery = If(Value(Label1.Text)>2, 32, 0)

 

This is saying if there are more than 2 items in my gallery then set the X of this label to 32, otherwise set it to 0

1 REPLY 1
Super User
Super User

Re: How can I center gallery items in a gallery?

If you want it always centered just drag the data to that spot in the gallery and it will stay there.

 

If you want it centered only when certain criteria are met you can use an If statement on the X value for each label and text input...something like:

 

You will need a label outside the gallery that is = CountRows(Gallery1.AllItems)

 

On label in Gallery = If(Value(Label1.Text)>2, 32, 0)

 

This is saying if there are more than 2 items in my gallery then set the X of this label to 32, otherwise set it to 0

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 27 members 4,231 guests
Please welcome our newest community members: