• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

html table background color

I have table that is looks like this

<table id="d1" style="margin:10px;background-color:#DFF1F8;border:1px solid;padding:8px;">

Initially the table is empty but it shows the background color and When I start putting rows inside of the table the table grows with the background

What I need is when the table is empty do not show the colors or table at all. I tried empty-cells:hide; but it does not work

1 Solution
That is not what empty-cells is for
Remove the padding - that is the only way
How many empty rows do you have?
You can use css:
table tr{background:#DFF1F8;}
table tr:irst-child{background:none}

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now