• Resolved business67

    (@business67)


    Hi,

    My tables no. 4 and no. 6 are not staying centered on my website. If I reload my website, they start centered for 0.1 seconds, but then jump immediately to the left.

    Here’s the code:

    .tablepress tbody td,
    .tablepress thead th {
    	text-align: center;
    	vertical-align: middle;
    }
    
    .tablepress-id-4,
    .tablepress-id-6 {
    	width: 500px;
    	margin: 0 auto 1em;
    }

    Does anybody know a solution for this? I want them to stay centered. Tried in different browsers and also mobile, but it’s always the same…

    Thanks in advance.

    • This topic was modified 3 years, 8 months ago by business67.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    That’s because you are using the JavaScript features on these tables, so that slightly different CSS code is needed. Please try again with

    #tablepress-4_wrapper,
    #tablepress-6_wrapper {
    	width: 500px;
    	margin: 0 auto 1em;
    }

    Regards,
    Tobias

    Thread Starter business67

    (@business67)

    Dear Tobias,

    Thanks, that works. Great!

    So I think I will have a few problems with this JavaScript issue in future, because it’s different from the normal way. Can I work without JavaScript? I didn’t use it consciously, it was more by chance.

    Thanks for your help.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    good to hear that this helped!

    I’m not sure why you are expecting trouble with these features, but if you don’t want searching/sorting, etc., you can of course turn that off, by unchecking the “Use DataTables” checkbox on the table’s “Edit” screen.
    After that, the CSS code that you posted originally should work fine.

    Best wishes,
    Tobias

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tablepress -> center of the table only for 0.1 seconds’ is closed to new replies.