Support » Plugin: TablePress - Tables in WordPress made easy » Background color doesn't change

  • Resolved Karen KISS WP Websites

    (@mtgamberwesbitedesign)


    Tablepress Version 1.4

    Hi Tobias,

    My client would like headers in different rows in the table to stand out more since his lists are quite long.
    An example can be seen at this demo page:
    http://www.mountgambierwebsitedesign.com.au/demowp2/advanced-trees/evergreen-test-table

    The code I have in the plugins options:
    .tablepress-id-3 .row-2,
    …. (lots more rows)
    .row-123 {
    font-weight: bold;
    background-color: #FDB048 !important;
    font-size: large;
    }

    The bold and large font changes can be seen but not the background color. I’ve tried it with standard WordPress themes and the same thing happens.

    When I look at it in Dev tools in Chrome, the background color line is faded out so it’s being ignored even though it has !important.

    I’ve tried copying code from other support threads that have the background color working but those same lines of code don’t work here and I don’t understand why.

    Any idea what I can do to get the background color to work?

    Thanks for your help,
    Karen

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi Karen,

    thanks for your post, and sorry for the trouble.

    The .row-... classes are attached to the HTML <tr> tags, but due to how the browser sets the “layers” of elements in a table, the color change has to be applied to the <td> elements in the rows. Additionally, due to how CSS selectors work, the .tablepress-id-3 part must be added to all lines, as the CSS would otherwise affect rows in other tables as well. Please try again with

    .tablepress-id-3 .row-2 td,
    .tablepress-id-3 .row-7 td,
    .tablepress-id-3 .row-13 td,
    .tablepress-id-3 .row-21 td,
    .tablepress-id-3 .row-30 td,
    .tablepress-id-3 .row-33 td,
    .tablepress-id-3 .row-39 td,
    .tablepress-id-3 .row-50 td,
    .tablepress-id-3 .row-59 td,
    .tablepress-id-3 .row-64 td,
    .tablepress-id-3 .row-75 td,
    .tablepress-id-3 .row-80 td,
    .tablepress-id-3 .row-82 td,
    .tablepress-id-3 .row-83 td,
    .tablepress-id-3 .row-89 td,
    .tablepress-id-3 .row-94 td,
    .tablepress-id-3 .row-98 td,
    .tablepress-id-3 .row-101 td,
    .tablepress-id-3 .row-103 td,
    .tablepress-id-3 .row-106 td,
    .tablepress-id-3 .row-108 td,
    .tablepress-id-3 .row-111 td,
    .tablepress-id-3 .row-121 td,
    .tablepress-id-3 .row-123 td {
    	font-weight: bold;
    	background-color: #FDB048;
    	font-size: large;
    }

    Regards,
    Tobias

    Thread Starter Karen KISS WP Websites

    (@mtgamberwesbitedesign)

    Okay that would explain the next thing I’ve just found which is that it’s affecting all the other tables too.

    I’ve just tried your amended version and it works.

    Thank you for such a quick response!

    Regards,
    Karen

    Plugin Author TobiasBg

    (@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 ‘Background color doesn't change’ is closed to new replies.