WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Change background color of whole column (6 posts)

  1. whirre
    Member
    Posted 5 months ago #

    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/

  2. TobiasBg
    Member
    Plugin Author

    Posted 5 months ago #

    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

  3. whirre
    Member
    Posted 5 months ago #

    Worked like a charm Tobias!

    And thanks for the unbelievable fast reply.

    Regards,
    Victor

  4. TobiasBg
    Member
    Plugin Author

    Posted 5 months ago #

    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!

  5. whirre
    Member
    Posted 5 months ago #

    Done! :-) Thank you Tobias!

  6. TobiasBg
    Member
    Plugin Author

    Posted 5 months ago #

    Hi,

    thanks, I really appreciate it!

    Best wishes,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic