Forum Discussion
Increase Font Size of List Web Part
jcgonzalezmartin yes, SharePoint online. And I believe so, the new List webpart.
TheWhiteGoose99 if you're using SharePoint Online, navigate to the list page and then select a column you want to change the font size to Column -> Column Settings -> Format This Column, a window appears on the right, Click Advanced Mode, and a text box appears for you to enter JSON code to manipulate the HTML. Copy and paste the Code snippet below into that JSON text box.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
"font-size": "18pt"
}
}
You can change the value "18pt" to whatever you want. The formatting settings will carry over to the Web part. Here's a https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting to more JSON formatting if you're interested.
Edit: I realize that you said you were utilizing wiki pages? This method will work with Modern list pages. (Tested)
- GokupeApr 13, 2023Copper Contributoramazing!!!
- mdodge51May 03, 2022Copper Contributor
Tyler_Tucker Very successful with changing Text size!! But was not successful in a "Person" column that is displaying Person bubbles. When I use the Code snippet the bubbles change to [object Object]. Thanks for the support!
- Gerry_Brimacombe1520May 29, 2024Copper ContributorIf you append ".title" the object, that should qualify the object enough to display.
Change:
"txtContent": "@currentField",
to
"txtContent": "@currentField.title",
It should work. Note however that the click/hover capabilities go away (can't click the username to see contact details). I'd love to know if there was a way around this! - Wedini85Aug 23, 2022Copper Contributor
mdodge51 Same here, in my case I'm using the URL field and instead of the URL I'm using the display field. Were you able to resolve this?
- Gerry_Brimacombe1520May 29, 2024Copper ContributorSee above. I haven't tested it, but try adding ".title" to the @currentField object.
"txtContent": "@currentField.title"
- Will2004Mar 22, 2022Copper Contributor3 years later and your code still works like a charm. Thanks!
- TheWhiteGoose99Jul 25, 2019Copper Contributor
Tyler_Tucker hey, this does increase the font for the actual list - but it doesn't seem to change the List webpart font size?