2

I want to highlight the whole row of the react mantine table on given condition for example if a value is mismatch in a cell I want to highlight the whole row.

my code looks like

this is I tried

const getRowStyle = (row) => {
    // return hasMismatch(row)
    //   ? { backgroundColor: 'rgba(255, 0, 0, 0.1)' }
    //   : {};
    return { backgroundColor: 'red' }
  };
<MantineTable
        columns={columns}
        initialData={skus}
        enableRowSelection={false}
        loading={loading}
        showSelectedToggle={false}
        hideSelectColumn={true}
        showResetAll={false}
        pageSize={10}
        enableColumnFilter={false}
        enableFilters={false}
        columnFilterDisplayMode={false}
        getRowProps={(row) => ({
          style: getRowStyle(row),
        })}
     />

I tried to do it in the < Cell > but no help.

If anyone can help me with some doc or code that will be huge help

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.