我想在ag-grid中更改headerName的字体大小

这似乎很简单,但是我似乎做不到。我已经尝试在我的scss文件中使用CSS,如下所示:

.ag-header-cell-text {
  font-size: 8px;
  color: red;
  background-color: red;
}

or like this:

.ag-header-cell
  font-size: 8px;
  color: red;
  background-color: red;
}

但没有任何变化,颜色也没有变化。设置headerheight可以但是对我没有帮助。我只想缩小字体。

I've also tried adding a cellStyle property to the columnDefs,but nothing seems to works,nor can I find a solution. Please help.
wslqfm 回答:我想在ag-grid中更改headerName的字体大小

添加 !important 可能会起作用。或者您的类名可能不正确。按f12检查(检查)并更正。

  .ag-header-cell-text {
      font-size: 8px !important;
      color: red !important;
      background-color: red !important;
    }
    .ag-header-cell
      font-size: 8px !important;
      color: red !important;
      background-color: red !important;
    }
本文链接:https://www.f2er.com/2925487.html

大家都在问