Tagged: table styling
-
AuthorPosts
-
May 23, 2019 at 4:28 pm #1103705
I’ve got 3 columns with heading rows. The second and third heading row columns need a different background color. See screenshot.
How do I do this?May 23, 2019 at 4:41 pm #1103715You can use the CSS nth-child selector to achive this:
.main_color tr.avia-heading-row th:nth-child(1) { background: red; } .main_color tr.avia-heading-row th:nth-child(2) { background: yellow; } .main_color tr.avia-heading-row th:nth-child(3) { background: green; }
May 23, 2019 at 6:39 pm #1103753Hey Christian,
Thanks for the suggestion. Hopefully it helps!
Best regards,
Jordan ShannonMay 23, 2019 at 7:48 pm #1103773thank you Christian,
It’s not working sadly.May 24, 2019 at 1:58 am #1103830Hi,
Did you add the css to the very top of quick css so it runs first. and clear the cache a few times over.
Best regards,
Jordan ShannonMay 24, 2019 at 9:02 am #1103870I cleared cache. It’s not working though.
May 24, 2019 at 10:38 am #1103884I just tested it … and it works.
See:
=> https://enfold.tabulor.de/testMay 24, 2019 at 10:43 am #1103886This is indeed what I’m trying to achieve. Still it’s not working on my site. I cleared the cache several times…
May 24, 2019 at 12:18 pm #1103910The table is standing in a content-section, which uses Alternate Content for background settings.
May 24, 2019 at 4:20 pm #1103944Then you can just change the CSS declaration to tables with ‘Alternate Content’ styling:
.alternate_color tr.avia-heading-row th:nth-child(1) { background: red; } .alternate_color tr.avia-heading-row th:nth-child(2) { background: yellow; } .alternate_color tr.avia-heading-row th:nth-child(3) { background: green; }
or use a more general declaration for all tables:
tr.avia-heading-row th:nth-child(1) { background: red; } tr.avia-heading-row th:nth-child(2) { background: yellow; } tr.avia-heading-row th:nth-child(3) { background: green; }
if you want to change it only in a specific area of the site add a custom CSS class to the mother layout element:
=> https://kriesi.at/documentation/enfold/add-custom-css/#enable-custom-css-class-name-support.my-special-area tr.avia-heading-row th:nth-child(1) { background: red; } .my-special-area tr.avia-heading-row th:nth-child(2) { background: yellow; } .my-special-area tr.avia-heading-row th:nth-child(3) { background: green; }
May 27, 2019 at 9:01 am #1104454This is not working for me. Can anyone help me?
May 27, 2019 at 11:52 am #1104493If you want help, you need to be more specific about what you tried, what’s not working. Or at least share a link to your current site.
There are now three working examples which are tested and proofed on an Enfold-installation and you just write “does not work” …May 27, 2019 at 12:04 pm #1104498I tried your CSS code.
I posted the info in private content.May 27, 2019 at 12:18 pm #1104500Ok … as i can’t see the private content i can’t help you any further.
May 27, 2019 at 12:20 pm #1104502Is there a moderator that can help me?
May 29, 2019 at 6:31 pm #1105235Hi,
Apologies for the delay. Add this to quick css:
.avia-pricing-table-container .pricing-table-wrap:nth-child(2) .avia-heading-row{ background:red!important; } .avia-pricing-table-container .pricing-table-wrap:nth-child(3) .avia-heading-row{ background:brown!important; }
Best regards,
Jordan ShannonMay 30, 2019 at 1:31 pm #1105420Perfect Jordan, works like a glove.
May 30, 2019 at 10:20 pm #1105510Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Table styling different background colors per heading column’ is closed to new replies.