• Resolved mackerg4

    (@mackerg4)


    Hi,

    I would like to have the text in column 1 of my table horizontally aligned to the left and the remaining columns horizontally aligned to the centre.

    Can I do that?

    Thanks

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Yes, that requires only a little bit of CSS. Please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

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

    Just change the table ID as necessary.

    Regards,
    Tobias

    Thread Starter mackerg4

    (@mackerg4)

    Works perfectly, thank you!

    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!

    Hello,
    I can center ant text in the cells with the css above. But I also have some images in the cells and these remain left aligned. How can I center the images separately from text? Or, is there a way to center all the cell containts in one go?
    Thanks

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi srujanika,

    centering images requires a slightly different piece of code.
    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

    I am working on local host now, will migrate to live server when all trials are over.
    I tried the following (from an old post)

    .tablepress-id-4 img {
    float: none;
    }

    Seems to work.
    Thanks a lot for the quick response.
    Regards,
    Nikhil

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, that’s one of the many possibilities here. Nice find! 🙂

    Best wishes,
    Tobias

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

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

The topic ‘Horizontal alignment of selected columns’ is closed to new replies.