angular - Angular Material Dynamic Table 的 Nostyle 已更改
问题描述
我使用了这个角度材料动态表。我想更改列宽,但我无法更改该表中的任何样式。这是用于测试的演示页面。我在 CSS 下面添加了测试是否有任何变化:
table, table td, table tr td, table th, .mat-cell, mdt-dynamic-table, mdt-dynamic-table table {
background-color: red;
}
为什么任何样式都不适用于该表?如何调整列宽或更改任何样式?
解决方案
看起来您的表格不是您要为其设置样式的组件的一部分。
你试过::ng-deep
吗?
https://angular.io/guide/component-styles
:host ::ng-deep table {
background-color: red;
}
推荐阅读
- c# - 动态 Lambda 表达式 - 选择子属性
- jetty - 从码头 9.4.8 升级到码头 9.4.14 的问题
- google-apps-script - 使用应用脚本从 Google 绘图创建 png 文件
- php - 有人可以帮我展示我的产品图片吗?
- java - 如何为 kafka 流使用多个使用相同主题的转换器?
- python - 通过在分类之前添加附加信息来自定义 CNN pytorch
- python - 循环链表的长度(python)
- php - 根据值添加或删除 PHP 字符串
- kubernetes - pod events 显示 persistentvolumeclaim "flink-pv-claim-11" 在 kubernetes 中被删除但绑定成功
- python - 如何从日期列中减去 5 年以在 python 数据框中创建新列?