Centering repeating group cells as it wraps

Anyone have a quick and easy way to center the repeating group cells as it wraps? I need both the RG centered and the cells centered.
Center RG

I know I could achieve this with conditional margins but just thought I’d quickly post here to see if anyone has any method that I’m not aware of.

The conditional margins is a very hack solution

Allow the ‘cards’ in the rg cell to expand width

Adjust minimum cell widths

Center the RG itself

It’s tricky and takes a bit of playing around

1 Like

Thanks for your help. I didn’t want to allow them to expand. I want the cards to all be the same width. Alright I’ll keep playing. Thanks

Hey Paul, are you saying that when there are two cards on top and one on the bottom, you want the card in the bottom row centered beneath the two in the top row? Just want to make sure I understand first.

You should be able to solve this by conditionally setting the number of columns when the width of the RG hits the lower breakpoint.

Can’t recall off the top of my head whether you can set the min width of column the same way (if you aren’t using a fixed number), but if you only ever have 3 columns it shouldn’t be an issue.

1 Like

If you mean like this…

rg-centered-cell-content
 
…then yeah. Assuming the RG is set to horizontally wrapped, just enable the Stretch columns to fill horizontal space option. Then make sure to center the card within the RG cell. (You’ll want to set a max width for the card.)


 
As you can see, the space between cards in each row will vary depending on the number of items in that row; but they will be evenly distributed and thus “centered”. Not sure if it’s exactly what you want, but it’s easy peasy hot and cheesy. :smile:

-Steve

3 Likes

Sorry for such a slow reply.

Thanks for your help. I did know about this option which I should have specified in my initial post. The thing I don’t love about this option is the space this creates between cells in the RG:

I came up with a css solution though for anyone who wants to achieve the same thing.
Tick off “Stretch columns…”
image

And put this css in the page header:
image

I thought Bubble still had not enabled that…glad I saw this post.