Title: [Plugin: WP-Table Reloaded] Table Row CSS
Last modified: August 19, 2016

---

# [Plugin: WP-Table Reloaded] Table Row CSS

 *  Resolved [swcomm](https://wordpress.org/support/users/swcomm/)
 * (@swcomm)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-table-row-css/)
 * Is there a way I can refer to data in a table cell or some other hidden field
   to grab the CSS selector or row background color to use in the custom CSS area?
   I have a series of tables that are color-coded by row, and need each datarow 
   to be one of two colors, but the colors used are not alternating rows — for example,
   I may have 6 consecutive rows of data using color 1, followed by one row of data
   using color 2, etc. I was thinking I’d put the color selector or RGB value into
   its own cell in each record, using a hidden column, but can’t figure out how 
   I’d refer to that cell/field in the custom CSS.
 * Or, is there another way to do this? Hope I explained what I’m looking for.
 * Fabulous plugin, thanks a bunch.

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-table-row-css/#post-1785058)
 * Hi,
 * I believe I understood what you want to achieve. Unfortunately, this is not that
   easy.
    There is no way that CSS can access the content of a table, especially
   not a hidden column, as the CSS will never see that column as well. (There might
   be developments in CSS in the future that allow such kind of dynamic queries,
   however, that’s still in the future.)
 * So, instead, you should look into a JavaScript solution:
    Mark your rows with
   an empty HTML of some kind (e.g. insert an empty `<span class="type-1"></span
   >` or `<span class="type-2"></span>` into a cell). Then, the JavaScript (with
   jQuery this should be easily possible) could loop through the rows, look for 
   that `<span>`, grab the class, and add that to the actual row’s classes. Your
   CSS would then only contain the actual stying for the `type-1` and `type-2` classes,
   while the actual work is done by JavaScript.
 * Best wishes,
    Tobias
 *  Thread Starter [swcomm](https://wordpress.org/support/users/swcomm/)
 * (@swcomm)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-table-row-css/#post-1785168)
 * Thanks for your reply. Span doesn’t exactly give me what I want, so after playing
   around with this a bit, thought I’d share how I resolved it.
 * I turned off all of the default and custom CSS generated by your plugin and added
   a function to my function.php file that lets me enter custom CSS per post/page.
   I then style the tables using my theme CSS and style the rows using your selector
   ids in the custom CSS in each post/page – gives me complete control over my row
   colors. It’s quite a bit of inline CSS, but I really need the ability to use 
   more than one set of custom CSS to style these rows, so styling at the post level
   seemed to be the best solution.
 * Thanks again for your help – as soon as I get paid for the project, will send
   you a donation!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-table-row-css/#post-1785173)
 * Hi,
 * thanks for the feedback and the report on how you solved it! Sounds reasonable
   and workable to me 🙂 Maybe it will also be helpful to others, so thanks for 
   sharing it!
 * Best wishes,
    Tobias
 * P.S.: And great to hear about that upcoming donation, I really appreciate it!
   Thank you!

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

The topic ‘[Plugin: WP-Table Reloaded] Table Row CSS’ is closed to new replies.

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

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-table-row-css/#post-1785173)
 * Status: resolved