Support » Plugin: TablePress » How To Center All Text On One Table?

  • Resolved MorphMan

    (@morphman)


    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/

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

    (@tobiasbg)

    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

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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

    Cheers for your help Tobias looks great now!

    Plugin Author TobiasBg

    (@tobiasbg)

    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

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How To Center All Text On One Table?’ is closed to new replies.