Forum Discussion

GLestina's avatar
GLestina
Copper Contributor
Oct 19, 2023

SharePoint View - Custom Formatting

I am trying to format a view so that when I add it to a page, it looks like this:

After doing custom formatting, it current looks like this:

 

How can I get rid of the extra white space?  Here is my View JSON and Column JSON:

 

 

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "hideFooter": true,
  "style": {
    "margin": "0px",
    "padding": "0px"
  },
  "attributes": {
    "class": "ms-bgColor-themePrimary"
  }
}
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "width": "600px"
  },
  "attributes": {
    "class": "ms-bgColor-themePrimary"
  },
  "children": [
    {
      "elmType": "div",
      "attributes": {
        "iconName": "DocLibrary",
        "class": "ms-bgColor-themeDarkAlt"
      },
      "style": {
        "font-size": "25px",
        "padding": "10px",
        "font-name": "Arial",
        "color": "white",
        "border-radius": "5px",
        "margin": "0px"
      }
    },
    {
      "elmType": "a",
      "style": {
        "text-decoration": "none",
        "font-size": "14px",
        "color": "white",
        "font-name": "Arial",
        "padding": "5px"
      },
      "txtContent": "@currentField",
      "attributes": {
        "title": "Delivery",
        "class": "ms-fontColor-themePrimary",
        "href": "='/sites/TST-EnterpriseGTPMO/Template/' + @currentField"
      }
    }
  ]
}

 

 

 

 

 Thanks!

No RepliesBe the first to reply

Resources