Solved

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

Posted on 2014-04-24
3
9 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
[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
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:Tom 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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