Hi,
thanks for your question.
This is possible with the Premium TablePress Extension from http://tablepress.org/download/extension/tablepress-row-highlighting.zip that needs to be installed and activated.
You can then use a Shortcode like
[table id=123 row_highlight="YES" /]
that will look for “YES” in the table.
Rows with the found highlight term in a cell will get a CSS class like “row-highlight-yes”. This can then be styled with “Custom CSS” like
.tablepress-id-123 .row-highlight-yes td {
background-color: #ff0000 !important;
}
Regards,
Tobias
Wow. Superfast response. I’ll take a look. Thanks!
Hi,
sure, no problem. I hope it helps! 🙂
Regards,
Tobias
Hmmm.. Just wondering if you would have to declare each table in CSS or whether you could make the highlight colour global?
Also – where’s the link to this plugin on your site? Seem to be blind to the link!
Hi,
sure, just use the global CSS class that affects all tables, as described in the TablePress documentation:
.tablepress .row-highlight-yes td {
background-color: #ff0000 !important;
}
About the link on the site: You’ll not find it, as I haven’t yet had the time do add it 🙂
Regards,
Tobias
Great!
I’ve got it all inserted now but no highlight.
Definitely will add a few dollars for your efforts later. 🙂
Hi,
ok, a few steps to check here:
– Did you really activate the new plugin?
– Did you modify the Shortcode?
– Does the table contain the exact word in a cell (by default, the Extension does exact cell matching)?
– Did you add the “Custom CSS”?
Can you maybe post a link to the page with the table, as well as the Shortcode that you used?
And thanks for wanting to donate, I really appreciate it!
Regards,
Tobias
My bad. I use YES as an example but my word was actually different. 😛
.tablepress .row-highlight-yes td {
background-color: #ff0000 !important;
}
I didn’t pick up the correlation of the phrase in the CSS code also. Now I’ve altered it accordingly and… Success!
Hi,
great! Good to hear that it is working now 🙂
And thanks for the donation, I really appreciate it!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
can you do this for multiple key words or only a single? exmaple:
[table id=7 row_highlight=”QB” row_highlight=”RB” /]
With the CSS
.tablepress .row-highlight-qb td {
background-color: #00FF00 !important;
}
.tablepress .row-highlight-rb td {
background-color: #0000FF !important;
}
Reason why I ask is because I can’t get it to work.
Hi,
thanks for your post, and sorry for the trouble.
In that case, you would have to put the desired words in one parameter value, separated by ||:
[table id=7 row_highlight="QB||RB" /]
Regards,
Tobias
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
One last question, and it is a question.
Are we able to use wildcards of some sort like:
[table id=7 row_highlight=”*QB||*RB” /]
Meaning, it could recognize anything before QB as part of the parameter to highlight the row? Just a question, didn’t want to create a new ticket to atleast keep all my questions together in the one thread.
Hi,
this is not directly possible with wildcards like *, but you can tell the Extension to look anywhere in the cell:
[table id=7 row_highlight="QB||RB" row_highlight_full_cell_match=false /]
(That would basically be the equivalent to "*QB*||*RB*" in your notation.)
Regards,
Tobias