Support » Plugin: TablePress - Tables in WordPress made easy » Highight Some Rows in some Columns

  • Resolved sjo007

    (@sjo007)


    Hi Tobias,

    Back again if I may. I am trying to highlight certain rows in a column which has an X in.

    I am using https://tablepress.org/faq/highlight-cells-or-content/ as a guide.

    When I place the CSS <span class=”hilite”>X</span> with X as my important value in the Front End custom CSS page – I receive errors. I have tried to add hilite and x as an extra CSS class in the table edit page under Extra CSS class again without success.

    Most grateful if you could help please. Many thanks

    Stephen

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    <span class="hilite">X</span> 
    

    is not CSS code, but HTML. This is what you put into the table cell.

    Then, you put

    .tablepress .hilite {
      color: #ff0000 !important;
    }

    into the “Custom CSS”.

    Regards,
    Tobias

    Thread Starter sjo007

    (@sjo007)

    Thanks Tobias – I have just made myself a very strong coffee to avoid me making silly mistakes in the future !

    What is the html if I want to make the cell background color a different color please ? I can do the CSS part.

    Thanks for the quick help !

    Best wishes,

    Stephen

    • This reply was modified 5 years, 2 months ago by sjo007.
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Stephen,

    unfortunately, it’s not really possible to change the full cell background with this method, basically because the <span> element is a “child element” of the cell. You could change most of the background by using a <div> instead of a <span>, like

    <div class="hilite">X</div>
    

    as that extends to the inner edges of the cell (but not into the cell’s padding).

    The other CSS approach mentioned in the link would be better to change the full cell background.

    Regards,
    Tobias

    Thread Starter sjo007

    (@sjo007)

    Many thanks Tobias – all understood and thanks once again for the quick reply.

    Best wishes,

    Stephen

    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 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Highight Some Rows in some Columns’ is closed to new replies.