Angular Mat table 突出显示一列

Angular Mat table highlight a column

是否可以在 mat-table 中突出显示一列?我可以看到一些突出显示行的示例,但我找不到任何有关突出显示列的信息。

您可以使用 css 来做到这一点。 css 之后将第 1 列突出显示为红色,将第 3 列突出显示为绿色。

.mat-header-cell:first-child,
.mat-cell:first-child {
  background-color: red;
}
.mat-header-cell:nth-child(3),
.mat-cell:nth-child(3) {
  background-color: green;
}