• Resolved davidschwartzer

    (@davidschwartzer)


    I just installed TablePress and created three tables which you can see here https://appletechtalk.com/buyers-guide/ .

    I would like to center the data in some of the columns to improve the spacing but can’t find any way to do that. Any suggestions? Also, is there a way to add bold or color to the text?

    Regards,

    David

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.

    For this, you can use CSS code. For example, add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-2 .column-4 {
      text-align: center;
      font-weight: bold;
      color: #ff0000;
    }

    Regards,
    Tobias

    Thread Starter davidschwartzer

    (@davidschwartzer)

    Tobias:

    Thanks for the quick response. As I am fairly new to WordPress and CSS I’m wondering if there is a more generic form of CSS I can add to the plug in that I can apply to every table at once rather than entering this same CSS but changing the table and possibly the column number each time?

    Regards,

    David

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi David,

    well, you could have this apply to all tables (by simply shortening .tablepress-id-2 to .tablepress, but the question is if you really want column 4 of all tables to be styled like this.

    It might make sense to use the table-ID-based selectors and then group them like this (as an example):

    .tablepress-id-2 .column-3,
    .tablepress-id-2 .column-4,
    .tablepress-id-6 .column-1,
    .tablepress-id-9 .column-3 {
      text-align: center;
      font-weight: bold;
      color: #ff0000;
    }
    
    .tablepress-id-1 .column-2,
    .tablepress-id-4 .column-3,
    .tablepress-id-5 .column-5,
    .tablepress-id-5 .column-6 {
      text-align: right;
      font-weight: normal;
      color: #00ff00;
    }

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Center Column Contents’ is closed to new replies.