Solved

html table background color

Posted on 2013-11-07
2
445 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
Comment Utility
That is not what empty-cells is for
Remove the padding - that is the only way
0
 
LVL 10

Expert Comment

by:GeoffSutton
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 …
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…

743 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

17 Experts available now in Live!

Get 1:1 Help Now