Center Table Exhibit Theme

  • Every time I try to add code to center a table, the table code disappears (thankfully the undo works and I have since saved it elsewhere). There must be something in this particular themes CSS that is now allowing the table to be centered.

    You can see the table here: https://greenshakersclub.com/awareness/

    Also, I would like the table on this page to not have a different colored background for the second row and to center this one, as well:

    https://greenshakersclub.com/partners/

    Can someone please help with this? Thank you so much for your time.

    The blog I need help with is: (visible only to logged in users)

  • Hi oilposse,

    Let me see if I can help you out here. If the code you’re entering is invalid, there is a chance that it will get erased when the system tries to validate it.
    I fiddled with the theme a little and found that this method should give you the effect you’re looking for.

    For the alignment, make sure your table is enclosed by

    <table align="center">
    </table>

    If you would like the second row background to be the same as the one above(in this case, white), add a “bgcolor” color to it. Please see the example below:

    <table align="center">
    <tbody>
    <tr>
    <th>Example</th>
    <th>Example</th>
    </tr>
    <tr>
    <td bgcolor="#ffffff">Example</td>
    <td bgcolor="#ffffff">Example</td>
    </tr>
    </tbody>
    </table>

    Please let me know if this resolves your issue. :)

  • Thank you for the reply. I have tried the basic <table align=”center”> and it does not work. The entire table goes away. Yes, the table is “enclosed” properly <table></table> and so forth for rows and columns. I’ve been coding for over 20 years (including building table codes) so this is not new to me, please understand this respectfully, there is something within the developers CSS that is keeping the table from being centered. I was hoping the developer could shed some light on this or if someone has dealt with this and knows how to use a custom CSS code that will “overwrite” whatever it is in the theme’s specific CSS that is not allowing the table to be centered.

    I’ve also tried the simple bgcolor for the row and the cells and the same issue happens, the table goes away.

  • Also, in my original message it should have said, “There must be something in this particular themes CSS that is NOT (not now) allowing the table to be centered.”

  • No problem–sorry that wasn’t helpful. That is very strange though, because the above worked for me with no issues. I can see how this can be very frustrating for you.

    Have you already tried making your page edits through the admin of your site here?

  • Hi there, the following custom CSS will center the table on that page only by using the unique page id CSS class from the opening body html tag on that page.

    .page-id-4 table {
        margin-left: auto;
        margin-right: auto;
    }
  • This will remove the color on the second row and center the table on the Partners page. Again, I’ve limited this to that particular page since you many not want all tables on all pages to follow these CSS rules.

    .page-id-2 table tr:nth-child(2n) {
      background-color: transparent;
    }
    .page-id-2 table {
      margin-left: auto;
      margin-right: auto;
    }
  • thesacredpath,

    THANK YOU, YOU ROCK!!! That worked perfectly. I appreciate you and your time very much.

    piyopiyofox,

    Thank you for taking time to try to help. I appreciate you very much.

  • thesacredpath —

    One more issue that maybe you can help with and I would greatly appreciate.

    If you look at the white space in the header area, there is just too much of it. Is there a way to reduce the width of this area? Right now it appears to be around 490 px width. Would love for it to be around 230-240 px.

  • wait, it is width, lol, I need to allow my brain to wake up before typing, apologies

  • This is for the greenshakersclub.com blog

  • Also, the issue with the height/width of the header, where the site title is located, the white space, only appears on the home page/front page.

  • Disregard request. I actually figured it out. Thanks again everyone.

  • You’re welcome, oilposse! Glad everything turned out all right.

    Thanks @thesacredpath! :)

  • The topic ‘Center Table Exhibit Theme’ is closed to new replies.