【问题标题】:Change color label TablePagination Material UI更改颜色标签 TablePagination Material UI
【发布时间】:2022-01-12 20:50:34
【问题描述】:

我有那个带有分页标签的表格。

(1-10 日 15)

我使用 Material UI 中的 TablePagination。

import TablePagination from '@mui/material/TablePagination';

我想知道如何更改此标签的颜色。

【问题讨论】:

    标签: reactjs material-ui


    【解决方案1】:

    您可以打开 chrome 开发工具并检查/检查用于特定组件的 CSS 规则,然后在 SX 道具中使用该规则名称并用您自己的 css 属性覆盖它。您还可以查看该组件的 API 页面,了解该组件中使用的所有 CSS 规则。

    根据您的情况检查以下代码,

    <TablePagination
    ...
      sx={{
        ".MuiTablePagination-displayedRows": {
          color: "red",
        },
        ".MuiTablePagination-selectLabel": {
          color: "green",
        },
      }}
    />
    

    【讨论】:

      猜你喜欢
      • 2020-07-08
      • 2019-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-02
      • 2019-03-20
      • 2020-12-26
      相关资源
      最近更新 更多