Title: Variable Cell Color by Data
Last modified: August 30, 2016

---

# Variable Cell Color by Data

 *  [mkeenan](https://wordpress.org/support/users/mkeenan/)
 * (@mkeenan)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/variable-cell-color-by-data/)
 * Is there a way to set variable cell background colors by data?
    For instance 
   if the data returned by the query for a given column is either STOP, SLOW or 
   GO can I set cell background as follows? STOP = RED SLOW = YELLOW GO = GREEN 
   Any help would be appreciated.
 * [https://wordpress.org/plugins/dbview/](https://wordpress.org/plugins/dbview/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/variable-cell-color-by-data/#post-6353935)
 * Sorry, don’t think cell background can be controlled programmatically. You can
   wrap the the cell contents in DIV or SPAN tags and set the background colour 
   using a STYLE attribute but that’s not quite the same thing.
 *  Thread Starter [mkeenan](https://wordpress.org/support/users/mkeenan/)
 * (@mkeenan)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/variable-cell-color-by-data/#post-6354082)
 * Can’t I just put something like this soewhere?
 * jQuery(“td:contains(‘GO’)”).addClass(‘greenBg’);
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/variable-cell-color-by-data/#post-6354086)
 * Yes, you could add some thing like that to handleDOMUpdates() in dbview.js; it
   will run after the table is loaded but it’s a bodge!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Variable Cell Color by Data’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dbview.svg)
 * [dbview](https://wordpress.org/plugins/dbview/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dbview/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dbview/)
 * [Active Topics](https://wordpress.org/support/plugin/dbview/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dbview/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dbview/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [john ackers](https://wordpress.org/support/users/john-ackers/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/variable-cell-color-by-data/#post-6354086)
 * Status: not resolved