0
votes

I've been trying to change the background color of a column in a Sharepoint list without full success.

I've been using below JSON code but what bugs me is that it don't fill out the whole cell.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "debugMode": true,
  "txtContent": "@currentField",
  "style": {
    "background-color": "pink"
  }
}

Current sharepoint list

Do you have any ideas on how to solve this?

Thanks

1

1 Answers

0
votes

This is due to the min-height property set.

As a workaround, you could enlarge the min-height to make it fill out the whole cell.

Example:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "debugMode": true,
  "txtContent": "@currentField",
  "style": {
     "min-height":"56px",
    "background-color": "pink"
  }
}