Structuring planet data playing with style:"backround-color" issue

G’day, mates.
Just finished planet table editing lesson. Thank you for the lesson.
After i wanted to implement other knowledges from previous lessons and faced with one small issue. When i implement style to column with everything works fine, except background-color. It remains white, i don’t know why. Can someone explain please, what am i doing wrong? here is example of what i got on codepen

<col style="background-color:yellow; border: 2px solid black">

Thanks in advance, guys

Hi there @tonybarracuda!

Your code looks really cool; I couldn’t think of anything to comment on. Well done!

As for your question, the background-color is working, but it s being overriden by the following rule:

th {
  background-color: rgb(235,235,235);

If you remove that, you’ll see your column background color.

The reason for this is that the <th> elements sit on top of the overall column, and by default they are colored transparent. But if you set a specific background color on them, it will cover over any color set on the column itself.

Hello, mate!
thank you for explanation, now i got it! because have not moved to CSS lessons yet, got this problem which is not a problem at all :slight_smile:

Well, it is still a bit confusing how <col> works. It is kind of a weird element that affects an area covered by other elements, while not really interacting with them (e.g. wrapping them) in the source code.

yes. i also got confused, then realized that <col> should go with number of column you want to edit, and then other <col> is +1 after previous one.
Still it’s a huge information to learn, the only thing i regret now that i have not started to learn it earlier )))