• Resolved qwepoian

    (@qwepoian)


    Hi, I read a FAQ, but I would like to add many style to particular cells.
    Whether there is a faster way to simplify this code?:

    .tablepress-id-1 .row-6 td:nth-child(1),
    .tablepress-id-1 .row-16 td:nth-child(1),
    .tablepress-id-1 .row-17 td:nth-child(1),
    .tablepress-id-1 .row-18 td:nth-child(1),
    .tablepress-id-1 .row-30 td:nth-child(1),
    .tablepress-id-1 .row-31 td:nth-child(1) {
    background-image: url(image.png);
    }

    Unfortunately, image may not be in every cell.
    When you have many tables and rows its problematic to check any row number ??

    Thank you in advance for your response.

    https://www.ads-software.com/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.

    No, sorry, I don’t really see a way to simplify this, as there’s no clear scheme in the row numbers.
    Instead of using :nth-child(), which is for example not supported by IE 8, if I remember correctly, I would use the .column-1 class, that every cells in the first column gets:

    .tablepress-id-1 .row-6 .column-1,
    .tablepress-id-1 .row-16 .column-1,
    .tablepress-id-1 .row-17 .column-1,
    .tablepress-id-1 .row-18 .column-1,
    .tablepress-id-1 .row-30 .column-1,
    .tablepress-id-1 .row-31 .column-1 {
      background-image: url(image.png);
    }

    Regards,
    Tobias

    Thread Starter qwepoian

    (@qwepoian)

    Thanks you – always less code ;).
    Whether it is possible to load a custom css from file? When I attach custom CSS to my child-theme style.css instead of “wp-admin/admin.php?page=tablepress_options” it’s not work corectly.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    the “Custom CSS” is already loaded from a separate file and that’s also minified automatically. I would not worry about this, and there’s no need to put the CSS into your theme’s “style.css”. If you prefer that, you might have to use the !important keyword:

    ...
    .tablepress-id-1 .row-31 .column-1 {
      background-image: url(image.png) !important;
    }

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom CSS to cells’ is closed to new replies.