Monday, January 14, 2019

How to display bigger image in SharePoint online list?

We have a SPO list migrated from SharePoint on-premises that displays a image from a URL. The previous image size is kind of object sequence decent and people are able to read the content. However, when we migrate to SPO, the image is extremely small as in the below screenshot that users could not read.


The solution for this type of the image display is to utilize the SPO column formatting. We quickly added the following column formatting to the column and it will display the image in desired size.

{
  "elmType": "div",
  "children": [
    {
      "elmType": "img",
      "attributes": {
        "src": "@currentField",
        "title": "=if(@currentField == '', 'No picture available', @currentField)"
      },
      "style": {
        "position": "relative",
        "top": "50%",
        "left": "50%",
        "width": "480px",
        "height": "auto",
        "margin-left": "-50%",
        "margin-top": "0%"
      }
    }
  ]
}


Bow you should fell conformable to adjust any SharePoint online list column based on what you prefer.

No comments:

Post a Comment