Solved

Removing White in CSS Table Borders

Posted on 2013-02-07
3
229 Views
Last Modified: 2013-02-07
In my CSS the result has a white border around my colored borders. Can you please tell me how to remove the white?

Also, the center panel is supposed to be 100% tall so it is a box around the content extending to the height of the frame it's in, but notice it is only as high as the content, not as high as the browser window it was in.

 result
Here is the code, but it is also in the HTML file attached. thanks!

<table style="margin: 0px; padding: 0px; border: 1px solid #000000; width: 100%; height: 100%; text-align: center; background-color: #ffffff;" cellspacing="0" cellpadding="0">
    <tbody>
        <tr>
            <td>
            <table style="margin: 0px; padding: 0px; border: 20px solid #efefef; width: 100%; height: 100%; text-align: center;">
                <tbody>
                    <tr>
                        <td>
                        <table style="margin: 0px; padding: 0px; border: 3px solid #006d00; width: 100%; height: 100%; text-align: center;">
                            <tbody>
                                <tr>
                                    <td style="width: 50%; height: 100% !important; text-align: center;">
                                    Testing 1 2 3
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>

Open in new window

HTMLPage.htm
0
Comment
Question by:Starr Duskk
  • 2
3 Comments
 
LVL 6

Expert Comment

by:nickinthooz
ID: 38866459
Is this something that has to be a table?  Div's would work so much better and it would be more current.
0
 
LVL 6

Accepted Solution

by:
nickinthooz earned 450 total points
ID: 38866491
anyhow,  try this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style>
    table {border-collapse: collapse;}
    td {border-collapse: collapse;}
    </style>
</head>
<body>
<table style="margin: 0px; padding: 0px; border: 1px solid #000000; width: 100%; height: 100%; text-align: center; background-color: #ffffff;" cellspacing="0" cellpadding="0">
    <tbody>
        <tr>
            <td>
            <table style="margin: 0px; padding: 0px; border: 20px solid #efefef; width: 100%; height: 100%; text-align: center;">
                <tbody>
                    <tr>
                        <td>
                        <table style="margin: 0px; padding: 0px; border: 3px solid #006d00; width: 100%; height: 100%; text-align: center;">
                            <tbody>
                                <tr>
                                    <td style="width: 50%; height: 100%;  text-align: center;">
                                    Testing 1 2 3
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
</body>
</html>

Open in new window


As far as the height,  TD is a child of TR. TR is the child of TABLE. In order for the TD to have a height of 100%, either the TR (not recommended) or the TABLE have to have a height of 100%. Because the TD can only be 100% of the height of its parent element.
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 50 total points
ID: 38866581
table{
border-collapse:collapse
}
td {
padding:0
}
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make Line Items Look Good Over Mobile 2 61
URGENT - Wordpress site missing  theme 9 41
css selector 1 17
Place text over image using CSS 6 44
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

810 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