• Resolved katielems

    (@katielems)


    I have searched the forums but have yet to find a CSS custom that does what I need it to. I am making a table and want rows 1, 2, 4, 6, 8, 10, and 12 centered. I have merged all of the rows except row 1, using Colspan. I appreciate your help!

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.

    This is possible using CSS code. For example, add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-123 .row-1 td,
    .tablepress-id-123 .row-2 td,
    .tablepress-id-123 .row-4 td,
    .tablepress-id-123 .row-6 td,
    .tablepress-id-123 .row-8 td,
    .tablepress-id-123 .row-10 td {
      text-align: center;
    }

    (where 123 needs to be changed to the correct table ID).

    Regards,
    Tobias

    Thread Starter katielems

    (@katielems)

    Thanks! That worked, except for row 1, which is not merged. Does that need a different code?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    is row 1 the table header row?
    Then, please use

    .tablepress-id-123 .row-1 th,
    

    as the first line of the code. (Note the th instead of td.)

    Regards,
    Tobias

    Thread Starter katielems

    (@katielems)

    Thank you! That solved the problem. One more question: the first column seems to be wider than the second. Is this because of my theme (Twenty Seventeen)? How do I make the 2 columns the same width?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    that’s good to hear! The width is probably different because the content in the columns has different length.
    To make it the same (for a two-column table), try adding this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-123 th,
    .tablepress-id-123 td {
      width: 50%;
    }

    Regards,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Centering Text on Merged Rows’ is closed to new replies.