• Resolved chaipope

    (@chaipope)


    Hi Tobias,

    I tried to change the padding of all cells in my table which has 5 rows (first row is th followed by td for subsequent rows) to 5px in the Custom CSS using:

    .tablepress-id-N th,
    .tablepress-id-N td {
    padding: 5px;
    }

    … but it didn’t work.

    When I make the changes individually like this:

    .tablepress-id-N .row-1 th,
    .tablepress-id-N .row-2 td,
    .tablepress-id-N .row-3 td,
    .tablepress-id-N .row-4 td {
    padding: 5px;
    }

    … it worked. I mean, there should be a technique to change the entire cells in a table, right? How to achieve that? Please advise. Thank you for your time.

    https://wordpress.org/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    You are totally correct, and the approach that you took does work in most cases. Unfortunately, some themes set cell paddings on their own, with CSS that has a higher priority. But with a small change (appending the !important flag) we should be able to make this work again:

    .tablepress-id-N th,
    .tablepress-id-N td {
      padding: 5px !important;
    }

    (with the N being changed to the correct table ID, of course).

    Regards,
    Tobias

    Thread Starter chaipope

    (@chaipope)

    Thank you Tobias. 😀

    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 3 replies - 1 through 3 (of 3 total)

The topic ‘Change padding of table’ is closed to new replies.