Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda