首页 > 解决方案 > 更改共享点列表中列的背景颜色

问题描述

我一直在尝试更改 Sharepoint 列表中列的背景颜色,但没有完全成功。

我一直在使用下面的 JSON 代码,但让我烦恼的是它没有填满整个单元格。

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

当前共享点列表

您对如何解决这个问题有任何想法吗?

谢谢

标签: jsonlistsharepoint

解决方案


这是由于min-height属性集。

作为一种解决方法,您可以放大min-height以使其填满整个单元格。

例子:

{
  "$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"
  }
}

推荐阅读