Support » Plugin: TablePress » Change background color of whole column

  • Resolved whirre

    (@whirre)


    Hi!

    Thanks for an amazing plugin!
    Im struggling with coloring an entire column.

    This is my non-working code:

    .tablepress-id-21 .column-5 td {
    background-color: #ff0000;
    }

    **Bonus question** How do I find out the column number? I just take for granted that the column “E” is “5”.

    Thanks in advance!

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

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    The td is already the element with the .column-... class, so the code would be

    .tablepress-id-21 .column-5 {
      background-color: #ff0000 !important;
    }

    Additionally (but that depends on the other styling, and on theme CSS), it might necessary to append the !important keyword to overwrite other CSS commands that e.g. change the background color of the row.

    And yes, the column number equals the position of the column letter in the alphabet. Or you can just count them 🙂

    Regards,
    Tobias

    Worked like a charm Tobias!

    And thanks for the unbelievable fast reply.

    Regards,
    Victor

    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!

    Done! 🙂 Thank you Tobias!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks, I really appreciate it!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change background color of whole column’ is closed to new replies.