`antd` table 如何改变table 头(thead) 的背景颜色和文本颜色?

How to change background color of table head(thead) and text color in `antd` table?

请告诉我如何更改 table 头(thead)的背景颜色和 antd table(antd ui 库)中的文本颜色

您可以通过覆盖 table header class 来更改 header 颜色 (您将从开发者工具中获取所有元素 classes) 对于 header class

.ant-table-thead>tr>th{
   background:#fdfdfd
}

因此它将全局覆盖颜色 要覆盖特定 table 的颜色,只需将 table 包裹在某些 div 中,方法是给 class "test" 并覆盖 css

.test .ant-table-thead>tr>th{
   background:#fdfdfd
}

它会更新特定 table 头部的颜色

文本颜色也相同。

.ant-table-row{
color:red
}