The easiest way is to use the extended properties on the table cells themselves (i.e. style). If the data is getting populated as the table is being loaded, then you may have to loop through the data after the query to populate a value and then use this values in the styles of your cells.
Another option may be to use an advanced query to retrieve the data, then you wouldn't need to loop through the data.