Change Table Header Background Color (2 posts)

  1. Aaress
    Posted 4 years ago #


    I'm having some trouble making the header row of a table a different background color. Every code I've tried so far either does not show up, or it only highlights the text a different color.

    For some reason, the WordPress forum won't let me post the table code, but if you visit the page below and view the source, you should be able to see the code fine.

    You can see the page here:

    THANKS for the help!

  2. vtxyzzy
    Posted 4 years ago #

    As far as I can see, the header row and its cells are not defined differently than all the other rows, so you can't use CSS to change the color without changing all rows.

    To allow different CSS rules, first change the header row HTML from this:

    <tr height="59">

    to this:

    <tr height="59" class="theader">

    Then, add this line to the end of style.css:

    tr.theader td {background-color: light-blue;}

Topic Closed

This topic has been closed to new replies.

About this Topic