How can I center the content of all the SharePoint Gallery cards?
1 Answer
Try this:
Follow my answer given here up to step #4 to enter into advanced mode in gallery view formatting.
Then add below styling to top/outer most
div
element in the JSON:
"style":{
"text-align": "center"
},
Output:
If any column value is not aligned to center automatically, locate the code used in same JSON for that particular column and then add "text-align": "center"
styling to nested elements wherever required.
-
Thanks only the profile picture doesn't align. I have tried this below but no luck: Commented Aug 5, 2023 at 6:28
-
"style": { "display": "=if(loopIndex('personIterator') >= 5, 'none', '')", "width": "72px", "height": "72px", "align": "center" }, Commented Aug 5, 2023 at 6:28
-
Are you showing person column and their profile picture in gallery view? Commented Aug 5, 2023 at 8:43
-
Yes i have a person column with the profile picture in gallery view :) Commented Aug 5, 2023 at 8:44
-
1I found the problem :) The Problem was Display: flex and i change it to: Display;inline-block Commented Aug 6, 2023 at 8:37