Forum Discussion
ShiranE
Feb 12, 2020Copper Contributor
List style in modern UI
Hi,
I'd like to reduce the padding of the cells in a Sharepoint list.
I tried playing around with the list view styles, but I see that they only affect the list in Classic View.
1. Why is it only in Classic view and not in the modern one?
2. Is there a way to change the display of the list so that more lines are shown on one view? (the question is not about number of lines per page... I know how to define it - but it's for seeing more lines without having to scroll down)
Thanks!
- RobElliottSilver Contributor
ShiranE modern SharePoint lists are very different to classic lists and don't work the same. But actually I find I can do a lot more with the formatting on a modern list than I ever could with a classic list.
You change the formatting of a column by clicking the dropdown in the column header, select Column settings and select Format this column. That opens a panel for you to type in/copy JSON code. As you'll see in the image below I've reduced the padding-left of the County column to 2px, set the color to a bright green and put a box round it:
The JSON code for that was:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
"padding-left": "2px",
"color": "#47a155",
"border": "1px solid"
}
}There are lots of ways you can format a column and some column types will have the formatting template done for you, others you have to enter the JSON yourself as I've done above.
Reducing the row height so you see more rows on screen in a modern list is not something that appears to be possible at the moment. Microsoft seem to have locked down the height to a minimum of 42px and I've not found a way to change that.
Rob
Los Gallardos
Microsoft Power Automate Community Super User