Hi @Martin, Heidi (SE GP T SP PS),
Is this an image type column? Did you apply any JSON column formatting to it?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Good morning, can someone tell me why a picture column displays the pictures in different sizes?
Thank you!
Hi @Martin, Heidi (SE GP T SP PS),
Is this an image type column? Did you apply any JSON column formatting to it?
Hi @Martin, Heidi (SE GP T SP PS),
Sorry for my late reply. I just come back from a vacation.
For image type columns, we have no way to fix or modify the images' sizes using JSON formatting. It is not supported by SharePoint.
As a workaround, you can create a Hyperlink or Picture column as an instead. Set Format URL as Picture.
Upload images to a document library and add items in the list with the link format: https://<tenant>/sites/<sitename>/<documentlibrayname>/<imagename>
Apply below JSON code to your Picture column. Modify the parameter values in the code to what you want the picture size should be like.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "img",
"attributes": {
"src": "@currentField"
},
"style": {
"position": "relative",
"top": "50%",
"left": "50%",
"width": "350px",
"height": "350px",
"margin-left": "-50%",
"margin-top": "0%"
}
}
]
}
Thanks.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.