Style to Datatable with dynamic columns ?

UI Components for React
Post Reply
Snchz
Posts: 1
Joined: 15 Dec 2020, 17:50

15 Dec 2020, 17:53

Hi i want to create a datatable with dynamic columns but i want that some cells have style, I see in the web but the example they have is only this

stockBodyTemplate(rowData) {
const stockClassName = classNames({
'outofstock': rowData.quantity === 0,
'lowstock': rowData.quantity > 0 && rowData.quantity < 10,
'instock': rowData.quantity > 10
});

return (
<div className={stockClassName}>
{rowData.quantity}
</div>
);
}

I try it, but it does't work..

can you help me ?

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

23 Dec 2020, 02:11

Hi,

Could you please check your css classes in DOM? Please check our demo;
https://primefaces.org/primereact/showc ... able/style

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests