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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    There are some errors in this code, from what I can see, and this code might not be the best solution. Are you trying to change the header row? Then please try https://tablepress.org/faq/change-background-color-table-head-row/

    Regards,
    Tobias

    Thread Starter lordvonaki

    (@lordvonaki)

    Hi Tobias,

    Thanks for your answer! I am trying to have each alernate row (1,3,5) with a different color from 2,4,6

    What’s the code for that?

    I checked “alternate color” box but it did not work either.

    Kind regards,

    Lordvonaki

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    that checkbox should actually work. To then change the used colors, you can use the CSS from https://tablepress.org/faq/change-color-alternating-rows/

    if that does not work, can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter lordvonaki

    (@lordvonaki)

    Hi,

    So it’s in the 3rd tab nav “LES UC” on this page: http://www.althos-patrimoine.com/contrat-de-capitalisation-cardif-elite/

    The code provided on the link you just sent would change all my tables and only want to change this one.

    Thanks for your help!

    Lordvonaki

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, the code would change all tables. To only influence one table, just add its table ID to the selector, by replacing all occurrences of .tablepress with .tablepress-id-123 (where 123 is the ID).
    In your case, this would be something like

    .tablepress-id-85 .odd td {
    	background-color: #f9f9f9;
    }

    By the way, the reason why we need this is that there’s already CSS code on your site that affects all TablePress tables. In particular, it changes the color of the first column, but also those of the other columns, and with that overrides the alternating row background colors.

    Regards,
    Tobias

    Thread Starter lordvonaki

    (@lordvonaki)

    Thanks tobias! It worked,

    Lordvonaki

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

The topic ‘changing css for rows on particular table’ is closed to new replies.