Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give empty cells a different background color

Tags:

css

css-tables

I was looking around the internet and couldn't find a solution to give empty cells in html/CSS a different background color.

While working on a system for festival production, I would like to draw attention of the producers (system users) to missing data in complex tables, by giving them an alerting color.

I know the background and the empty cell property of course, but there doesn't seem to be a combination, since the empty cell property only has hide, show and inherent. But I guess there is some solution somewhere...

Any ideas how to solve this?

like image 212
user1627596 Avatar asked Oct 28 '25 05:10

user1627596


1 Answers

Use :empty

To see how to change the css background with jQuery, check out this jsfiddle: http://jsfiddle.net/5sVAt/1/

Else, just do the CSS version

td:empty{
    background-color: red;
}
like image 95
Kyra Westwood Avatar answered Oct 30 '25 18:10

Kyra Westwood