更改共享点列表中列的背景颜色

问题描述 投票:0回答:2

我一直在尝试更改 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

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

谢谢

json list sharepoint
2个回答
0
投票

这是由于

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

0
投票

我的柱子高度各不相同。有没有办法在没有最小高度的情况下做到这一点

© www.soinside.com 2019 - 2024. All rights reserved.