Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

327
Views
react mui-datatables 4, can't customize style

I'm using "mui-datatables": "^4.2.2", "@mui/material": "^5.6.1", i tried to customize style like this :

Customize Styling official doc

// MUI DATATABLES

import MUIDataTable from "mui-datatables";
import { createTheme, ThemeProvider } from "@material-ui/core/styles";
import { CacheProvider } from "@emotion/react";
import createCache from "@emotion/cache";

const options = {
  filter: false,
  filterType: "checkbox",
  download: true,
  sort: false,
  responsive: "vertical", // standard | vertical | simple
  selectableRows: "multiple",
  selectableRowsOnClick: false,
  print: true,
  viewColumns: false,
  searchOpen: false,
  search: true,
  page: 0,
  pageSize: 10,
  // rowsPerPage: 10,
  rowsPerPageOptions: [],
  textLabels: {
    body: {
      noMatch: "Aucun enregistrement correspondant trouvé",
    },
    pagination: {
      next: "Suivant",
      previous: "Précédent",
      rowsPerPage: "Rows per page:",
      displayRows: "sur",
    },
    toolbar: {
      search: "Recherche",
      downloadCsv: "Télécharger CSV",
      print: "Imprimer",
      viewColumns: "Afficher les colonnes",
      filterTable: "Tableau de filtrage",
    },
    selectedRows: {
      text: "ligne(s) sélectionnée(s)",
      delete: "Supprimer",
      deleteAria: "Supprimer les lignes sélectionnées",
    },
  },
  customToolbarSelect: (selectedRows) => console.log(selectedRows),
};

const muiCache = createCache({
  key: "mui",
  prepend: true,
});

const getMuiTheme = () =>
  createTheme({
    components: {
      MUIDataTableBodyCell: {
        styleOverrides: {
          root: {
            backgroundColor: "#000000",
          },
        },
      },
    },
  });

and then inside the react function component i return :

 <CacheProvider value={muiCache}>
              <ThemeProvider theme={getMuiTheme}>
                <MUIDataTable
                  title={"Accueil"}
                  data={data}
                  columns={columns}
                  options={options}
                />
              </ThemeProvider>
            </CacheProvider>

I should have a dark body cell, but nothing is changed

enter image description here

How can i fix this issuer ? Thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!