I am using JSON to format list view in SharePoint online list. Why is my tile view in web part on site pages rendering wider than in the default list page?
A related question: How can I change the height of the Cover section (cover is an image). Warning: I am a newbie to JSON. Here is my JSON code (modified from existing SharePoint code):
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
"height": 360,
"width": 250,
"hideSelection": false,
"fillHorizontally": true,
"formatter": {
"elmType": "div",
"attributes": {
"class": "sp-card-container"
},
"children": [
{
"elmType": "a",
"attributes": {
"class": "sp-card-defaultClickButton",
"role": "presentation",
"href": "[$Link]"
}
},
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-borderHighlight sp-card-subContainer"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "sp-card-previewColumnContainer"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "sp-card-imageContainer"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-neutralLight sp-card-imagePreviewBackground"
},
"children": [
{
"elmType": "img",
"style": {
"display": "=if([$Cover] == '', 'none', '')"
},
"attributes": {
"src": "=getThumbnailImage([$Cover], 400, 400)",
"title": "[$Cover.fileName]",
"class": "sp-card-imagePreview"
}
}
]
}
]
}
]
},
{
"elmType": "div",
"attributes": {
"class": "sp-card-displayColumnContainer"
},
"children": [
{
"elmType": "p",
"attributes": {
"title": "[$Title]",
"class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent",
"role": "heading",
"aria-level": "3"
},
"txtContent": "=if ([$Title] == '', '–', [$Title])"
}
]
},
{
"elmType": "div",
"attributes": {
"class": "sp-card-lastTextColumnContainer"
},
"children": [
{
"elmType": "p",
"attributes": {
"title": "[$Notes]",
"class": "ms-fontColor-neutralPrimary sp-card-content sp-card-multiline",
"width": 250
},
"txtContent": "=if ([$Notes] == '', '–', [$Notes])",
"style": {
"height": 150,
"word-break": "normal"
}
}
]
}
]
}
]
}
}
Thanks.