Solved

html table background color

Posted on 2013-11-07
2
447 Views
Last Modified: 2013-11-07
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

table
{
border-collapse:separate;
empty-cells:hide;
}
0
Comment
Question by:erikTsomik
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39632199
That is not what empty-cells is for
Remove the padding - that is the only way
0
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 39632588
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

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
css help with menu spacing 10 30
Not showing page correctly 3 29
Problem with a CSS in a page 2 25
Configuring a checkbox in CSS and php 18 27
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now