1

I've been trying to change the card size in a list gallery view. It doesn't seem to accept the height and width of the cards displays as its default size. Is there something I'm missing or might be getting in the way?

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "height": "250",
  "width": "500",
  "hideSelection": true,
  "groupProps": {
    "headerFormatter": {
      "elmType": "div",
      "txtContent": "@group.fieldData",
      "style": {
        "font-size": "22px",
        "font-weight": "bold",
        "flex-wrap": "wrap",
        "display": "flex",
        "box-sizing": "border-box",
        "padding": "4px 8px 5px 8px",
        "border-radius": "6px",
        "align-items": "center",
        "white-space": "nowrap",
        "overflow": "hidden",
        "margin": "1px 4px 4px 1px",
        "background-color": "=if(@group.fieldData == 'Done', '#CAF0CC', if (@group.fieldData == 'Cancelled', '#FABBC3', if(@group.fieldData == 'In Progress', '#D4E7F6', if (@group.fieldData == 'Proposed', '#FFEBC0',  ''))))"
      }
    }
  }
}

3 Answers 3

1

You can word wrap the header. Just add in-line styling to include “white-space”: “normal” and “word-break”: “keep-all” “display”: “inline-block” or “display”: “flex” “position”: “relative”

0

You can only adjust the gallery view if you provide the formatter value to determine what the card content should be. Adjusting your format from above you can see things in action like this:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
  "height": "250",
  "width": "500",
  "hideSelection": true,
  "formatter": {
    "elmType": "div",
    "txtContent": "Wowee!",
    "style": {
      "background-color": "tan"
    }
  },
  "groupProps": {
    "headerFormatter": {
      "elmType": "div",
      "txtContent": "@group.fieldData",
      "style": {
        "font-size": "22px",
        "font-weight": "bold",
        "flex-wrap": "wrap",
        "display": "flex",
        "box-sizing": "border-box",
        "padding": "4px 8px 5px 8px",
        "border-radius": "6px",
        "align-items": "center",
        "white-space": "nowrap",
        "overflow": "hidden",
        "margin": "1px 4px 4px 1px",
        "background-color": "=if(@group.fieldData == 'Done', '#CAF0CC', if (@group.fieldData == 'Cancelled', '#FABBC3', if(@group.fieldData == 'In Progress', '#D4E7F6', if (@group.fieldData == 'Proposed', '#FFEBC0',  ''))))"
      }
    }
  }
}

If you are expecting that the card view that's shown by default will show up there, you'll need to remove your format and then adjust the design view of the card (do literally anything), then switch to Advanced mode. All the JSON will be there and you can merge your format into that.

0
0

You can switch to Advanced mode to check all JSON of Gallery view formatting

Please following steps:

1.On the Gallery view, click "Format current view"

enter image description here

2.On the Format view windows, click "Edit card"

enter image description here

3.On the Card Designer windows, click "Advanced mode"

enter image description here

4.You can change the value of "height" and "width"

enter image description here

enter image description here

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.