WordPress.org

Forums

Kirumo
table element in child theme (7 posts)

  1. arrow1head
    Member
    Posted 9 months ago #

    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

  2. CrouchingBruin
    Member
    Posted 9 months ago #

    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.

  3. arrow1head
    Member
    Posted 9 months ago #

    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.

  4. CrouchingBruin
    Member
    Posted 9 months ago #

    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;
    }
  5. arrow1head
    Member
    Posted 9 months ago #

    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.

  6. CrouchingBruin
    Member
    Posted 9 months ago #

    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;
    }
  7. arrow1head
    Member
    Posted 9 months ago #

    Terrific, thanks for the advice.

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.