+ 1

CSS Styling Table

I tried to coloring it with the pseudo selector, but it went weird. What's wrong with this code? https://sololearn.com/compiler-playground/WtMo765cTZkk/?ref=app

25th Nov 2024, 2:44 AM
Ilham Fadilah
Ilham Fadilah - avatar
2 odpowiedzi
+ 4
tr:nth-child(1) is th also, why not just use odd-even? tr:nth-child(odd){ background-color:blue; } tr:nth-child(even){ background-color:red; }
25th Nov 2024, 3:59 AM
Bob_Li
Bob_Li - avatar
+ 2
Bob_Li Thank you, I thought the header was a separate code, so it didn't count in the pseudo selector.
26th Nov 2024, 1:14 AM
Ilham Fadilah
Ilham Fadilah - avatar