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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    The easiest approach for this should be some “Custom CSS”. For example, add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-1 thead .column-3,
    .tablepress-id-1 thead .column-4,
    .tablepress-id-1 thead .column-5,
    .tablepress-id-1 thead .column-6,
    .tablepress-id-1 thead .column-7,
    .tablepress-id-1 thead .column-8 {
      text-align: center;
    }

    Regards,
    Tobias

    Thread Starter cyklokopce

    (@cyklokopce)

    thank you for your answer, but it is not working. Just for case, I made a prentscreen from tablepress options window for you so u can see if I copied it correctly. If you have any suggestions I will appreciate it… https://postimg.org/image/6ux7hhjuh/

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    please try again with what I posted, and do not change the column numbers to letters.

    Regards,
    Tobias

    Thread Starter cyklokopce

    (@cyklokopce)

    Thx for help, it works now. What I meant was to align header row + whole columns C-H, from bottom to the top. But I’ve figured it out now, with your advice like this:

    .tablepress-id-1 tbody .column-3,
    .tablepress-id-1 tbody .column-4,
    .tablepress-id-1 tbody .column-5,
    .tablepress-id-1 tbody .column-6,
    .tablepress-id-1 tbody .column-7,
    .tablepress-id-1 tbody .column-8 {
    text-align: center;
    }

    thank you!!!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah, sorry, I misread that. For this, you can then use the much shorter

    .tablepress-id-1 thead th,
    .tablepress-id-1 .column-3,
    .tablepress-id-1 .column-4,
    .tablepress-id-1 .column-5,
    .tablepress-id-1 .column-6,
    .tablepress-id-1 .column-7,
    .tablepress-id-1 .column-8 {
      text-align: center;
    }

    (with the first line, this also centers the full head row).

    Regards,
    Tobias

    Thread Starter cyklokopce

    (@cyklokopce)

    Cool, finally I begin to understand how it works. thx one more time

    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!

    Thread Starter cyklokopce

    (@cyklokopce)

    done ??

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks, I really appreciate it!

    Best wishes,
    Tobias

    And how can you center content inside tables both horizontally and vertically?

    Thanks

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Usually, some “Custom CSS” like

    .tablepress-id-123 tbody td {
      text-align: center;
      vertical-align: middle;
    }

    should work, but this might depend on the actual content and the theme.

    Regards,
    Tobias

    Sorry that didn’t help, but thanks.

    When I insert that code it only center it horizontally, but not vertically. It is still aligned vertically top.

    Did you have issue like that?

    Thanks

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link! Your theme is also adding CSS code that affects tables, so that we’ll need to raise the priority of the “Custom CSS”. For that, we can use the !important flag, so please extend the line
    vertical-align: middle;
    to
    vertical-align: middle !important;

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Tablepress center align’ is closed to new replies.