Forum Discussion
amccormack
Microsoft
Sep 01, 2022SharePoint - Wrap text in gallery view
Hi All,
Been scouring a while now looking for an answer. I've seen a lot of posts about this but cannot get anything to work. I am trying to get the 'new title' column to wrap the text so the e...
amccormack
Microsoft
Sep 02, 2022Unfortunately, that didn't work. But I will check out the documentation you shared and see if I can come up with something. Thanks for the help.
bakline
Aug 09, 2023Copper Contributor
amccormack did you ever figure it out? Having the exact same problem. Nothing works. The json editor keeps saying it’s not valid code and won’t even save in sharepoint online.
- ALOE_2023Mar 12, 2024Copper Contributor
bakline amccormack I was able to get the title to wrap using a combo of white-space and word-break. I think what was key was placing the code below "txtContent."
"elmType": "p", "attributes": { "title": "[$Title]", "class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent", "role": "heading", "aria-level": "3" }, "txtContent": "=if ([$Title] == '', '–', [$Title])", "style":{ "white-space": "wrap", "word-break": "keep-all"}
Here is how this looks in practice:
- kskyllingmarkApr 30, 2024Copper ContributorHow to get text to wrap in the column headers also?
- Luise FuzyMar 21, 2024Copper ContributorYou rule.