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

    (@tobiasbg)

    Hi,

    thanks for your question.
    To do that, you will need a little bit of CSS code. Please see this article in the FAQ to understand how to influence a single cell: https://tablepress.org/faq/highlight-cells-or-content/
    Instead of changing the background color as in that example, you’ll then need this CSS code to center:

    text-align: center;

    Regards,
    Tobias

    Thread Starter Agha Mehdi

    (@agha-mehdi)

    Hi Tobias,

    Thank you for the reply. I tried what you said and unfortunately, I think mostly due to my lack of experience, I cant get it to work. I need numerous cells to be centrally aligned and neither have done so.

    I’ll copy the code into here and let me know what I’m doing wrong. Thank you very much in advance>

    .tablepress-id-4 .row-1 .column-a {
    text-align: center;
    }

    .tablepress-id-4 .row-1 .column-b {
    text-align: center;
    }

    .tablepress-id-4 .row-1 .column-c {
    text-align: center;
    }

    .tablepress-id-4 .row-1 .column-d {
    text-align: center;
    }

    .tablepress-id-4 .row-2 .column-a {
    text-align: center;
    }

    .tablepress-id-4 .row-2 .column-b {
    text-align: center;
    }

    .tablepress-id-4 .row-2 .column-c {
    text-align: center;
    }

    .tablepress-id-4 .row-2 .column-d {
    text-align: center;
    }

    .tablepress-id-4 .row-4 .column-a {
    text-align: center;
    }

    .tablepress-id-4 .row-4 .column-b {
    text-align: center;
    }

    .tablepress-id-4 .row-4 .column-c {
    text-align: center;
    }

    .tablepress-id-4 .row-4 .column-d {
    text-align: center;
    }

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    basically, you will just have to use the column number instead of the letter. Additionally, you can shorten that CSS a lot:

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

    If you post the link to the page with the table, I’ll gladly take a look to see if we can make this even shorter.

    Regards,
    Tobias

    Thread Starter Agha Mehdi

    (@agha-mehdi)

    Thank you.

    Here is the link:https://goirani.com/each-package-payment-options/

    I am trying to create a table which I have created in MS Word. I can send you a version if you like.

    Thank you. Much respect for your work here.

    Mehdi

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Mehdi,

    thanks for the link. Unfortunately, I can’t open the page, as it just asks me for an email address ??
    Additionally to the link, can you post which cells you want centered?

    Regards,
    Tobias

    Thread Starter Agha Mehdi

    (@agha-mehdi)

    Hi Tobias,

    Sorry for the mistake there.

    I am wanting to center all the text in column 2.3.4 on all rows up to row 20.
    Here is the link.
    https://goirani.com/listing-package-tick-table/

    It seems like I have ti scroll to the next page to see all the rows. Can I make them all appear on the same page?

    Thank you

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    unfortunately, I still can’t see the table ?? It’s still asking me to enter my email address to get notified…

    Centering those cells should not be a problem, but I’d need to see the table to be sure.

    To make all rows appear on the same page, just uncheck the “Pagination” checkbox on the table’s “Edit” screen.

    Regards,
    Tobias

    Thread Starter Agha Mehdi

    (@agha-mehdi)

    Hey Tobias, Sorry about that. Its been disabled so you should be able to go in and check that.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks, no I can see the table. ??

    Please replace all of your “Custom CSS” with this:

    .tablepress-id-5 img {
        margin: 0;
        border: 0;
        background-color: transparent;
    }
    .tablepress-id-5 .column-2,
    .tablepress-id-5 .column-3,
    .tablepress-id-5 .column-4 {
        text-align: center;
    }

    Regards,
    Tobias

    Thread Starter Agha Mehdi

    (@agha-mehdi)

    Absolutely perfect. Thank you for the support and the great plugin.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    great! ?? And no problem, you are very welcome!

    Best wishes,
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Center align text’ is closed to new replies.