Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kowarler

    (@kowarler)

    Perhaps I could use ‘padding’ but don’t know how to add it it to a cell rather than the whole table…

    At the moment – I’ve added some carriage returns to shift the text down a bit – but it looks quite untidy at the moment!

    Thread Starter kowarler

    (@kowarler)

    No ideas anyone?

    Center horizontally (right-to-left) or vertically (top-to-bottom)? Either way:

    You will need to add CSS to accomplish this (either to your theme’s style.css or via a plugin that lets you add additional CSS to your site without touching the theme (Jetpack’s “Custom CSS” module, for example, if you have Jetpack installed.))

    Center horizontally in cell.

    text-align: center;

    Center vertically in cell

    vertical-align: middle;

    For your particular case, we are defining the style of table 6, column 2. Choose one or both of either text-align or vertical-align below.

    #tablepress-6 .column-2 {
    text-align: center
    vertical-align: middle;
    }

    If/when you do the above, you can remove your line breaks.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Just as Joe Banks mentions, the vertical-align CSS property is your friend, which you should use instead of removing padding or adding extra line breaks.
    So, for your table, please try replacing

    .tablepress-id-6 td {
    	padding-top: 0;
    	border: none;
    	background: none;
    	text-align: left;
    }

    with

    .tablepress-id-6 tbody td {
    	border: none;
    	background: none;
    	text-align: left;
    	vertical-align: middle;
    }

    Regards,
    Tobias

    Thread Starter kowarler

    (@kowarler)

    That works perfectly – thank you so much!

    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 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Centre text within cell (equal space top and bottom)’ is closed to new replies.