Tagged: 

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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?

    #1103715

    You 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;
    }
    #1103753

    Hey Christian,

    Thanks for the suggestion. Hopefully it helps!

    Best regards,
    Jordan Shannon

    #1103773

    thank you Christian,
    It’s not working sadly.

    #1103830

    Hi,

    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 Shannon

    #1103870

    I cleared cache. It’s not working though.

    #1103884

    I just tested it … and it works.

    See:
    => https://enfold.tabulor.de/test

    #1103886

    This is indeed what I’m trying to achieve. Still it’s not working on my site. I cleared the cache several times…

    #1103910

    The table is standing in a content-section, which uses Alternate Content for background settings.

    #1103944

    Then 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;
    }
    #1104454

    This is not working for me. Can anyone help me?

    #1104493

    If 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” …

    #1104498

    I tried your CSS code.
    I posted the info in private content.

    #1104500

    Ok … as i can’t see the private content i can’t help you any further.

    #1104502

    Is there a moderator that can help me?

    #1105235

    Hi,

    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 Shannon

    #1105420

    Perfect Jordan, works like a glove.

    #1105510

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Table styling different background colors per heading column’ is closed to new replies.