• Resolved midrik

    (@midrik)


    Hi,

    Awesome plugin, thank you for you effort!

    (Im using the most recent version 1.6.1)

    Im trying to center text in all tables on my site, except I always want column number 1 to be left aligned.

    So I need:

    Left – Center – Center – Center – etc..

    Im trying to use:

    .tablepress-id-2 .column-2,
    .tablepress-id-2 .column-3,
    .tablepress-id-2 .column-4,
    .tablepress-id-2 .column-5,
    .tablepress-id-2 .column-6, {
    text-align: center;
    }

    I know Im targeting a specific table in the above but thats only for testing. Not sure how I can make this apply to all tables?

    Additionally it does not center anything for me on table with id 2.

    Here is a link to my site:

    http://backup.is/landvelar/shop/lagnaefni/ror/hathrysti-stal-og-rydfri/hathrysti-stal-og-rydfri/

    I know almost nothing about css so I would appreciate if you could help me with this.

    Thank you.

    https://wordpress.org/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    To target all tables, just use the .tablepress selector. Additionally, you’ll have to make sure that there’s not comma right before the {.
    It might also be easier (and shorter code) to set the alignment to center for all cells first, and then set it to left-aligned again for the first column. In summary, please try this CSS code:

    .tablepress th,
    .tablepress td {
      text-align: center;
    }
    .tablepress .column-1 {
      text-align: left;
    }

    Regards,
    Tobias

    Thread Starter midrik

    (@midrik)

    Thank you so much Tobias, its perfect now 🙂

    Plugin Author Tobias Bäthge

    (@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!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Column text align center’ is closed to new replies.