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

214
Views
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 answers
Answer question

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 Report
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!