Solved

Can't get rid of 1 pixel spacing above and below embedded table using style tags

Posted on 2014-04-24
3
7 Views
Last Modified: 2016-06-21
If you put the code in an asp.net page you will see that there is a pink, 1 pixel space above and below the embedded table.

                <table style="width:100%; padding:0px; border-spacing:0px; border-collapse:separate;">
                    <tr style="background-color: #d75f07; height: 10px; color: white; text-align: center">
                        <td>

                            <asp:Label ID="lblGeneralAnnouncementHeader0" runat="server" style="font-size: medium" /> &nbsp;<asp:Label ID="lblGeneralAnnouncement0" runat="server" style="font-size: small" />

                        </td>
                    </tr>
                    <tr style="background-color: pink; color: white; text-align: center">
                        <td align="center">
                            <table style="width:1170px; height:105px; padding:0px; border-spacing:0px; border-collapse:collapse; background-color: purple">
                                <tr>
                                    <td>

                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr style="background-color: #d75f07; height: 10px; color: white; text-align: center">
                        <td>

                        </td>
                    </tr>
                </table>   

Open in new window

0
Comment
Question by:tatton777
3 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 40020992
in TD tag (line 10), add

padding-top: 0px;

same for all other sides

td {
  padding-top:0px;
  padding-bottom:0px;
  padding-right:0px;  
}
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 500 total points
ID: 40021621
Hi tatton777
This fixed it on my machine:
<head runat="server">
    <title></title>
  <style type="text/css">
    table { 
      border-spacing: 0;
      border-collapse: collapse;
    }
    td{padding: 0px;}

  </style>
</head>

Open in new window

Respectfully yours,
Alan
0
 
LVL 5

Expert Comment

by:knowlton
ID: 41664117
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Alan Warren (https:#a40021621)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

knowlton
Experts-Exchange Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

791 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