Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, I just addressed the same question a few days ago and this solution worked for me.

    In your page place this:

    <div id=tablepress-2_wrapper>
    [table id=2  /]</div>

    In your Admin/Tablepress/plugin options/custom css place this:

    div#tablepress-2_wrapper {
    	width: 800px;
    	margin-left: auto;
    	margin-right: auto;
    }

    This will also align the search box.

    I hope it works for you.
    Cheers,
    Paulo

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The approach with the extra <div> wrapper will work fine, although the name should be chosen differently, to not create conflicts with the DataTables JS library (which actually adds a wrapper with that name already).

    In this case, we won’t need an extra wrapper, but will have to be more strict with the CSS, as your theme also has CSS that influences tables.
    So, to center your table, please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    #content .tablepress-id-5 {
      width: auto;
      margin-left: auto;
      margin-right: auto;
    }

    Regards,
    Tobias

    Thread Starter soulesteemcenter

    (@soulesteemcenter)

    Thank you, Paulo and Tobias.

    Tobias, that code did the trick without creating conflicts with the theme we’re using.

    Thanks so much for your help!
    Sonja

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Center and resize table’ is closed to new replies.