WordPress.org

Support

Support » Themes and Templates » table element in child theme

table element in child theme

  • Hi there,

    I love the theme, but I’m looking to make a simple change to the table formatting. I don’t want the alternating box-shadow in the table rows. I’ve tried to change it using Tablepress but have been unsuccessful. I cannot find the table element in the .php files. Is there any advice you can give me on how to find the table element so I can change it in my child theme?

    Thanks very much,

    Enzo

Viewing 6 replies - 1 through 6 (of 6 total)
  • Can you post a link to a page on your site which contains a table? Usually, alternate shading of table rows is done using CSS. If you inspect the table using a web debugging tool like firebug or chrome developer tools, you should be able to see the CSS rules which govern the shading.

    Thanks for the reply.

    Here’s a link: http://www.copysage.com/writing-samples/

    I have attempted to locate the relevant CSS using “inspect element” in Chrome, but have not been able to.

    It’s this CSS rule, which is changing the background of the even numbered table rows:

    tr:nth-of-type(even) {
       background: #e8e8e8;
    }

    To eliminate the shading, add this rule to the end of your child theme’s style.css file:

    tr:nth-of-type(even) {
       background: transparent;
    }

    Worked like a charm – thank you!

    One more thing…could you help me remove the border box around the table? I’ve tried to figure it out, and again, couldn’t find the right code to insert.

    You want to make the rule specific enough so that it doesn’t affect other tables which might be on the site. Each page or post has a unique ID that you can use to make the CSS rule affect only elements on that page:

    .page-id-4 table {
       border: 0;
    }

    Terrific, thanks for the advice.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘table element in child theme’ is closed to new replies.