WordPress.org

Ready to get started?Download WordPress

Forums

CSS Help - Table formatting (6 posts)

  1. kelemvor
    Member
    Posted 1 year ago #

    Howdy,

    I'm trying to add a table to my website and NOT have the default CSS stuff apply to it. I can't find a way to do this.

    I decided to try assign a class name to the table and setting specific values for it but that doesn't seem to help.

    The table properties seem to be being overwritten by stuff in a #content flag:

    In my style.css file I have this:

    #content tr td {
    border-top: 1px solid #e7e7e7;
    padding: 6px 24px;
    }

    I tried setting Table class="x" and then setting up things like

    table.x td {
    font-size: small;
    padding: 0px 0px;
    width: 14%;
    height: 80px;
    text-align: left;
    vertical-align: top;
    }

    When the page renders, it's using data from both of the tags but the #content one is overriding the 'x' one and I can't remove the padding. I don't want to change the main style as I don't know how many places that might be being used right now.

    Is there some other way I can do this? Does that make sense?

    Thanks

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    It sounds as though you need the support of a CSS forum like http://CSSCreator.com/forum

  3. wpcanyon
    Member
    Posted 1 year ago #

    #content .x tr td { /* code */ }
  4. kelemvor
    Member
    Posted 1 year ago #

    That worked. hmm. Don't know why but it worked. :)

    Thanks.

  5. wpcanyon
    Member
    Posted 1 year ago #

    You're welcome.

    It works because it's more specific. If you wanna know more about it check this tutorial -> CSS Specificity: Things you should know.

  6. kelemvor
    Member
    Posted 1 year ago #

    Sheesh. If it wasn't quitting time I'd read that. I'll bookmark it for next week.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags