Row colour
Row colour
Hi all,
I am quite new to DataTables but it seems to me very useful. I would like to ask you something regarding row colouring.
I have a database of 2000 records - sales orders, each has several items. I need to color each sales order by specific color.
e.g. sales order number 100 with all the items will be coloured in blue etc.
Already I have a hex code in my database. Here is a short example of my db. So first row should be in colour #FFEFDB
and second/third lines should be in #FF4040
order control colour
4 M02 #FFEFDB
333 M02 #FF4040
333 M02 #FF4040
Is there any chance to do this using some function ? If yes, where to put the code.
Thank you for any advice
Petr
I am quite new to DataTables but it seems to me very useful. I would like to ask you something regarding row colouring.
I have a database of 2000 records - sales orders, each has several items. I need to color each sales order by specific color.
e.g. sales order number 100 with all the items will be coloured in blue etc.
Already I have a hex code in my database. Here is a short example of my db. So first row should be in colour #FFEFDB
and second/third lines should be in #FF4040
order control colour
4 M02 #FFEFDB
333 M02 #FF4040
333 M02 #FF4040
Is there any chance to do this using some function ? If yes, where to put the code.
Thank you for any advice
Petr
This discussion has been closed.
Replies
Or, you could use mRender to look for specific items in cells and then rewrite the HTML for that row.
Or, you could hook into fnCreatedRow to either add a CSS class or a HTML background-color at that time. There are a variety of appraoches.