WordPress.org

Support

Support » Themes and Templates » Trouble with Tables

Trouble with Tables

  • I am trying use tables with Modularity-lite with the HTML table codes. The first row will appear normal and the following row will have a white rectangle covering the entire row covering text from being seen. This pattern will alternate. I tried setting a transparant background using bgcolor and style attribute with background-color but I can’t get around this.

    <table border="0" cellspacing="0" cellpadding="0" width="760" style="background-color:none;">
    <tbody>
    <tr><td>the cells</td><td>on this row</td><td>look fine</td><tr>
    <tr><td>this row</td><td>has a white</td><td>screen</td><tr>
    </tbody>
    </table>

    If anyone has any suggestions I would love to hear them.

Viewing 8 replies - 1 through 8 (of 8 total)
  • I’ve just had this issue.

    My CSS was utilising a library file which set this highlighting. If you add the following to your CSS it should over ride the highlighting.

    tbody tr:nth-child(even) td, tbody tr.even td {background:transparent;}
    tbody tr:nth-child(odd) td, tbody tr.odd td {background:transparent;}

    Regards,

    Mark

    Mark

    Where would the code go?

    Hi Mike,

    Sorry for the delay, I put the code in style.css

    #slideshow .slide img {
    display: block;
    max-width: 950px;
    text-align: center;
    margin: 0 auto;
    }
    tbody tr:nth-child(even) td, tbody tr.even td {background:transparent;}
    tbody tr:nth-child(odd) td, tbody tr.odd td {background:transparent;}
    /* =Navigation
    -------------------------------------------------------------- */

    Regards,

    Mark

    I’m a real newby but from the code you posted, it looks like your row tag isn’t being closed. </tr>

    OTC

    No idea mate, it works for me, just sharing the knowledge 🙂

    For the avoidance of doubt the only lines I added were:

    tbody tr:nth-child(even) td, tbody tr.even td {background:transparent;}
    tbody tr:nth-child(odd) td, tbody tr.odd td {background:transparent;}

    Cheers,

    Mark

    Josh

    @josh401

    Moderator and Editor Customizer

    You are correct OTC. The <tr> tag should always be closed with a </tr>.

    (Just posting this for future reference.)

    Ah, I think your talking about the original post by travelingbard?

    If so that makes more sense to me!

    Cheers,

    Mark

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Trouble with Tables’ is closed to new replies.
Skip to toolbar