Forum Discussion

Nathan_Clark's avatar
Nathan_Clark
Copper Contributor
Oct 29, 2024

Sharepoint List Spacing

New to creating things via sharepoint. What I want is to have 4 selectable buttons that are 150px x 100px with the title shown and upon selecting the content it would open the link to a different site in a new tab. Everything works as it should, minus the huge space between the text/buttons. This is created via a list. I need all 4 to be on the same plane and ideally always be 600px wide combined

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
  "hideSelection": true,
  "hideColumnHeader": true,
  "fillHorizontally": true,
  "formatter": {
    "elmType": "div",
    "attributes": {
      "class": "sp-card-container"
    },
    "style": {
      "display": "flex",
      "flex-wrap": "wrap",
      "margin": "10px",
      "gap": "10px"
    },
    "children": [
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-bgColor-white"
        },
        "style": {
          "height": "100px",
          "width": "150px",
          "justify-content": "center",
          "align-items": "center"
        },
        "children": [
          {
            "elmType": "div",
            "attributes": {
              "onclick": "window.open('[$Link]', '_blank')"
            },
            "children": [
              {
                "elmType": "a",
                "attributes": {
                  "title": "[$Title]",
                  "href": "[$Link]",
                  "target": "=if ([$Link] == '', '', '_blank')"
                },
                "txtContent": "=if ([$Title] == '', '–', [$Title])",
                "style": {
                  "color": "#000000",
                  "font-weight": "regular",
                  "font-size": "40px",
                  "padding": "10px",
                  "text-decoration": "none"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

 

 

 

  • Rob_Elliott's avatar
    Rob_Elliott
    Bronze Contributor

    Nathan_Clark Why not just use the Quick Links web part on a SharePoint page?

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

Resources