Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

html table background color

Posted on 2013-11-07
2
450 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

829 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