-
AuthorPosts
-
October 6, 2014 at 8:38 pm #331156
Hi!
I have a pricing table which I am using as a working hours table. Basically I want to set all its background in white except the cells where you see “ABIERTO”. Those ones would be in another colour, dark purple.
I’ve read a lot of threads but non of them (I didn’t find anyone) was fitting my needs.
Can you help me, please?
Thanks!
- This topic was modified 10 years, 2 months ago by blancocapell.
October 9, 2014 at 2:49 am #332833Hi,
Try adding this at the very end of your theme / child theme functions.php file:
function td_abierto_script(){ ?> <script> (function($){ $(window).load(function() { $('.avia-table td').each(function() { var $this = $(this); if($this.text() == "ABIERTO"){ $this.addClass('td_abierto'); } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'td_abierto_script');
And this to Quick CSS:
table td, table th { background: white; } .td_abierto{ background: purple; }
Regards,
Josue- This reply was modified 10 years, 2 months ago by Josue.
October 9, 2014 at 5:29 pm #333361Hi Josué.
That doesn’t work because of two reasons:
1) It applies to all of the tables, so for example in the tab “Talleres” you can see all the tables in white, and it was cool already like at the beginning.
2) We should also change the text colour to black to ALL the cells. Note that now, in the purple ones, the text is not black, it’s a gray very dark.So, basically, I want the change only for that table I told you. I created a custom CSS class for that table, if it helps. It’s called “naikare-horario”.
And also I would want to let you know that at the end I’m not planning to have “ABIERTO” in the cells. This means that the function (or whatever you provide me) shouldn’t depend on the text.Thanks again, and sorry for all the mess :P
October 9, 2014 at 6:57 pm #333397Hey!
Thank’s for your feedback.
Out of the box the table object does not support your request. If you need that, you have to modify
enfold\config-templatebuilder\avia-shortcodes\table.php
to allow to add specific classes to single cells. This will be the only way to be independent from cell content.
But this is beyond the scope of support.
Best regards,
GünterOctober 10, 2014 at 8:00 pm #334060Oh…
Well, OK, I understand it.
Thanks anyway.
-
AuthorPosts
- The topic ‘Change specific cells background colour in a specific table’ is closed to new replies.