• Resolved robaa

    (@robaa)


    Hi — newbie alert! ??

    I’m trying to centre-align all text in my table. Everything else works, except the head row which remains left-aligned.

    I first started with this:

    .tablepress-id-2 tbody td {
    text-align: center;
    }

    …and since that didn’t do the trick, I also added:

    .tablepress-id-2 .row-1 {
    text-align: center;
    }

    …as well as:

    .tablepress-id-2 thead {
    text-align: center;
    }

    What am I doing wrong?

    (FYI, I have left-aligned column 1, in case that makes any difference here?)

    Thanks in advance for any help!

    robaa

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Please try this version:

    .tablepress-id-2 thead th {
      text-align: center;
    }

    If that is still not working, 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

    Thread Starter robaa

    (@robaa)

    Thank you, Tobias – that worked! ??

    Was it because I’d left out the ‘th’ from the field name?

    Thanks,
    robaa

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

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

    Yes! th refers to the actual cells in the header and those need to get the settings. They are basically the equivalent to td elements which are the cells of table body rows.

    Best wishes,
    Tobias

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

    Thread Starter robaa

    (@robaa)

    Great thanks.

    Have just left 5* review. ??

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks, I really appreciate it!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Table head row alignment not working’ is closed to new replies.