Hi Georgi,
changing the color of a table cell can be tricky.
In your example you are using JQuery to color the cell's, and that will definetly lead to strange behaviour (especially, when you scroll the table, use the paginator or change the width of columns and so on...)
Here's a simple example that uses the formatter in combination with CSS classes:
Maybe that fits your requirements, otherwise you have to dig deeper into it. If so, I would suggest to read though the following threads:
Greets,
ben