Solved

html table background color

Posted on 2013-11-07
2
457 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
[X]
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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

691 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