WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] How To Center All Text On One Table? (10 posts)

  1. MorphMan
    Member
    Posted 9 months ago #

    Hi Tobias,

    I'm sure there is a pretty easy solution to this but so far after a few hours of searching I can not find the solution.

    I would like to center ALL of the text in ALL cells for one table only that I have created.

    I have used this code in the “Custom CSS” but seems not to work?

    .tablepress-id-3{
    text-align:centre;
    }

    Any ideas on how to solve this?

    Cheers
    Mark

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi Mark,

    thanks for your question, and sorry for the trouble.

    That CSS is almost correct. Please try again with

    .tablepress-id-3 tbody td,
    .tablepress-id-3 tbody th {
      text-align:center;
    }

    Regards,
    Tobias

  3. MorphMan
    Member
    Posted 9 months ago #

    Hi Tobias,

    That works great! All is centered apart from the table header text - I would like the table header text to be centered also? Is there an extra line of code to add to the above for this?

    Cheers
    Mark

  4. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi Mark,

    good to hear that this helped!
    Unfortunately, I'm not sure why this is not working on the table header text. My assumption is that your theme also contains CSS code that influences this. To find out more, please post a link to the page with the table, so that I can take a direct look. Thanks!

    Regards,
    Tobias

  5. MorphMan
    Member
    Posted 9 months ago #

    Hi Tobias,

    I have used the <center> </center> tags on each of the individual table header text and this has worked! - i'm not sure if this is the correct way? but seems to work?

    http://morphmonkey.com/package-pricing/
    (site still under construction)

    Cheers
    Mark

  6. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi Mark,

    well, it is a possible way, but it's not he nicest/cleanest one, in my opinion. If it works for you, it's no problem to use it.

    Regards,
    Tobias

  7. MorphMan
    Member
    Posted 9 months ago #

    Cheers for your help Tobias looks great now!

  8. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    ah, just saw that you added a link :-) Great! That helped, as I found the cause for the problem: The code I gave you is wrong... Sorry about that...

    Please try again with

    .tablepress-id-3 tbody td,
    .tablepress-id-3 thead th {
      text-align:center;
    }

    With that, you can remove those <center> tags. Additionally, please go to the "Edit" screen of the page and switch from the "Visual" to the "Text" editor. You will probably see something like

    <p style="text-align: left;">

    around the table Shortcode. I recommend to remove that as well, so that the table Shortcode stands on its own line, with an empty line before and after it.

    Regards,
    Tobias

  9. MorphMan
    Member
    Posted 9 months ago #

    Thanks Tobias!

    I've made all of the above changes and all is looking great - thanks for your help and support 5 Star review already left

  10. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    great to hear that this worked :-) And sorry again for the initial mistake in the code...
    Thanks for the rating, I really appreciate it!

    Best wishes,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic