Tagged: , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #890737

    Hi,

    i had defined my own custom table styling created offline (link to jsfiddle) as I didn’t want to use the theme’s own table styles. However, it seems that the theme’s table styling is adding some styles which I do not want.
    This is how it looks without the theme styling:
    Desired table styling
    This is how it looks when I put in the theme (code block on page, css in Quick CSS)
    Table in Enfold

    Do I have have to define css to override everything that the theme’s own styling has for tables? Or is there a simple way to “mute” the theme’s own table styling (without it overriding when I update the theme)? I am unlikely to ever use the theme’s own table styles.

    Thanks in advance.

    Kind Regards
    David

    #890858

    Hey David,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #890872

    Hi Victoria,

    Details below. The website is in coming soon state, so you need to go via the admin portal. The table is on the page I’ve stated below. The link to the jsfiddle is in my original post.

    Thanks & Kind Regards
    David

    #891061

    Hi,

    Please try the following in Quick CSS under Enfold->General Styling:

    .avia_codeblock table tr:nth-child(odd) {
      background:#fff !important;
    }

    Best regards,
    Rikard

    #891072

    Thanks, but the alternating background is just one part of the styling I want to remove.
    The question is: do I really need to define styles to override every part of the theme’s table styles that I don’t want with an “!important” declaration (cell text vertical and horizontal align, borders, margins, text transform)? I don’t think that’s particularly ideal, and not good css practice. I may wish to add another codeblock table styled differently.
    What I would like to do is just remove all of the theme’s table styling – is that possible?

    Kind Regards
    David

    #891226

    Hi David,

    You don’t always need to use !important. Many times you need to specify an additional class to increase the selector specificity and the styles will work. Or you can give your tables a special class and write css using the class.

    Best regards,
    Victoria

    #891393

    Hi Victoria,
    That’s fine.
    I had defined a specific class for the table, but where I hadn’t defined a bit of css (where it wouldn’t be otherwise needed) it used the theme default instead. So I’ve had to define css to override the theme defaults to get the result I was looking for (which I was hoping to avoid!)
    Thanks & Kind Regards
    David

    #891428

    Hi,

    Did you need additional help, or shall we close this topic?

    Best regards,
    Jordan Shannon

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.