• Resolved swollenfox

    (@swollenfox)


    Hello all,

    I am trying to center a table (http://theswollenfox.com/test-calendar-page/) and nothing seems to work. I tried…

    .wp-table-reloaded-id-2 {
    margin: 10px auto 15px!important;
    }

    … which did nothing

    I also tried:

    <div style=”width:100%; text-align:center;”>[table id=N /]</div>

    … which only centered the title of the table.

    Can anyone help me out? Huge thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    your table is actually centered.
    The problem however is that the content area (in which it is centered) is too small.
    According to your theme CSS, it is 640px wide. And due to the padding that your theme’s CSS applies to table cells, the table takes up more than that space.
    So, to fix this, you will need to do two things:
    Add the following “Custom CSS” to reduce the padding in the cells:

    .wp-table-reloaded-id-3 th,
    .wp-table-reloaded-id-3 td {
      padding: 4px!important;
    }

    Then, you will need to change the theme’s CSS. You can do this through the WP-Table Reloaded “Custom CSS” textfield as well (so that you won’t have to change actual theme files). Just add:

    .one-column #content {
      width: 100%!important;
    }

    Be warned however that this will influence all pages in your site that use the “one-column” layout of the theme.

    Now, after these changes, your table should fill up the entire content area, so you won’t need any code to center it.

    Best wishes,
    Tobias

    Thread Starter swollenfox

    (@swollenfox)

    Tobias,

    Thank you so much!!! You are a genius.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are welcome! 🙂

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Centering a table — nothing works’ is closed to new replies.