Conditional Cell Styling
In order to add conditional cell styles, follow this guide.
import "./styles.css";
import { CTable } from "react-minimalist-table";
const data = [
{
Student: "Cecilia Ovalle",
Grade: 100
},
{
Student: "Edgar Arroyo",
Grade: 50
}
];
export default function App() {
return (
<div className="App">
<CTable
data={data}
conditionalCellStyle={[
{
columns: ["Grade"],
validation: (value) => value > 70,
styleTrue: {
color: "white",
background: "#7BCC70"
},
styleFalse: {
color: "white",
background: "#b43757"
},
defaultStyle: {
color: "black"
}
}
]}
/>
</div>
);
}
Conditional Cell Style Props.
Last updated