json 更改SharePoint列表中列的背景色

edqdpe6u  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(73)

我一直在尝试更改Sharepoint列表中列的背景色,但没有完全成功。
我一直在使用下面的JSON代码,但让我感到困扰的是,它没有填满整个单元格。

{
  "$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
你有什么办法解决这个问题吗?
谢谢

r7xajy2e

r7xajy2e1#

这是由于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"
  }
}

字符串

相关问题