如何更改 antd 表中表头(thead)的背景颜色和文本颜色?

发布于 2025-01-18 22:04:13 字数 65 浏览 2 评论 0原文

请向我解释如何更改表头的背景颜色(thead)和文本颜色antd表(ANTD UI库)

Please explain me how to change background color of table head(thead) and text color in antd table (antd ui library)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沧桑㈠ 2025-01-25 22:04:13

您可以通过覆盖台式标头类更改标头颜色
(您将从开发人员工具中获得所有元素类)
对于标题课,

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

因此, 它将覆盖全球颜色
为了覆盖特定表的颜色,只需通过提供“测试”,只需将表包裹在某些div中
并覆盖CSS

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

,它将更新特定表头的颜色,但

文本颜色也只有相同。

.ant-table-row{
color:red
}

you can change header colour by overriding table header class
(you will get all the element classes from developer tool)
for header class

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

as a result it will override the color globally
to override the color for specific table only just wrap the table in some div by giving class "test"
and override the css

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

and it will update the color for specific table head only

same for the text color as well.

.ant-table-row{
color:red
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文