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

213
Vistas
Can I make a Material-Table column render data like this?

I am using a standard Material-Table. I would like to render the column status like in the image down below. I could use ANT Design to do this, but Material-Table requires a lot less code to allow for searching and filtering.

Here is a very simple example of my table. I am using some options to set the header color, font etc. I am also using rowStyle to alternate colors on each row.

const [intakes, setIntakes] = useState([]);
const columns = [
        { title: "Status", field: "Status" },
    ];

function Table() {
  return (
    <MaterialTable data={intakes.intakes} columns={columns} />
  );
}

enter image description here

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

In your columns definition, you will need to use the render property of the column object. A similar question is here

code example:

<MaterialTable       
    columns={[
      { title: "Name", field: "name" },
      { title: "Surname", field: "surname" },
      { title: "Id", field: "tableData.id" },
      { title: "Id+1", render: rowData => rowData.tableData.id + 1 },
    ]}/>

This is the important part here:

render: rowData => rowData.tableData.id + 1

using the rowData, you can call a function here using a specific field other than the id in the example (let's say

render: rowData => generateFlagText(rowData.tableData.Status)

And your function should return some div with classNames to display those status

about 4 years ago · Santiago Gelvez Denunciar
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