Support » Plugin: TablePress » Highlighting whole columns

  • Resolved Rican UK

    (@rican-uk)


    Hi,

    I’m having problems applying a colour to a whole column. Below is the code I inserted into the CSS section.

    .tablepress-id-1 .column-2 {
    	background-color: #ff0000;
    }

    Occasionally, it will just highlight the cell in the first row, but mostly, it doesn’t make any difference at all.

    Please can someone advise what CSS I need to add to change the background colour of a whole column.

    Many thanks!

    DS

    http://wordpress.org/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    As the coloring for alternating row colors works with similar code, you’ll have to raise the priority of this change. Please try again with

    .tablepress-id-1 .column-2 {
    	background-color: #ff0000 !important;
    }

    Regards,
    Tobias

    Thanks for your reply Tobias.

    Its working great now.

    DS

    Hello again,

    I’ve just been thinking, is it possible to change the colour of the column, but also have the hover-over work?

    At the moment, after I’ve changed the colour, the hover-over doesn’t seem work.

    Look forward to hearing from you.

    DS

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    good to hear that this already helped!
    To fix the hover effect, please extend the code to this:

    .tablepress-id-1 .column-2 {
    	background-color: #ff0000 !important;
    }
    .tablepress-id-1 .row-hover tr:hover td {
            background-color: #f3f3f3 !important;
    }

    Regards,
    Tobias

    Thanks. Thats great!

    One last thing: is it possible to put a border line between columns like there is between rows?

    If so, is it also possible to only have those lines between columns 1 & 2 and 3 & 4?

    Trust this makes sense.

    MT
    Dale

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, that’s also possible with some CSS code:

    .tablepress-id-1 .column-2,
    .tablepress-id-1 .column-4 {
      border-left: 1px solid #dddddd;
    }

    Regards,
    Tobias

    Thats brilliant Tobias. Works a treat!

    Many thanks!

    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!

    Many thanks for the tip with column highlighting.
    How is the code, when I want to highlight the complete column except the first row?

    Thank you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question!

    With “first row”, do you mean the header row? Then the code would be

    .tablepress-id-1 tbody .column-2 {
    	background-color: #ff0000;
    }

    (where the tbody defines that this shall only apply to the data rows).

    Regards,
    Tobias

    Absolutely perfect!
    Thank you very much. Will donate tomorrow.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!
    And thanks for wanting to donate, I really appreciate it!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Highlighting whole columns’ is closed to new replies.