Unexplained Whitespace

Discussion in 'ASP .Net' started by cfps.Christian, Nov 27, 2007.

  1. I'm not too terribly efficient in HTML or ASP.NET but I know enough to
    get into trouble

    <table id="tblImgAlign" runat="server" width="100%" cellspacing="0"
    style="border-style:none" cellpadding="0">
    <tr>
    <th style="width:179px; border-style:none">
    <asp:Image ID="imgLeft" runat="server" ImageUrl="~/
    Images/TopLeft.PNG"/>
    </th>
    <th style="background-image:url(/Images/TopCenter.PNG);
    background-repeat:repeat-x; border-style:none">
    <asp:Label ID="lblHeader" runat="server"
    Text="Testimony Apparel" />
    </th>
    <th style="width:217px; border-style:none; margin-top:0px">
    <asp:Image ID="imgRight" runat="server" ImageUrl="~/
    Images/TopRight.PNG"/>
    </th>
    </tr>
    </table>

    The final image has a chunk of whitespace right above it which is
    preventing the 3 images from lining up. If anyone has any ideas on
    what could be causing it please tell me.

    I've tried the margins, imagealign, and a few other things that are
    simple.

    The Source also leaves the whitespace unexplained.
     
    cfps.Christian, Nov 27, 2007
    #1
    1. Advertising

  2. cfps.Christian

    Dave Bush Guest

    The tab character, newline character, and linefeed characters all count
    as a space in html. They only show as one space, but they all count.

    This is esp. a problem with images, as you've seen. To get around it,
    you want to have all of your ending brackets touching your beginning
    brackets in the area where your images are.

    <table id="tblImgAlign" runat="server" width="100%" cellspacing="0"
    style="border-style:none" cellpadding="0">
    <tr>
    <th style="width:179px; border-style:none"><asp:Image
    ID="imgLeft" runat="server" ImageUrl="~/
    Images/TopLeft.PNG"/></th>
    <th style="background-image:url(/Images/TopCenter.PNG);
    background-repeat:repeat-x; border-style:none">
    <asp:Label ID="lblHeader" runat="server"
    Text="Testimony Apparel" />
    </th>
    <th style="width:217px; border-style:none;
    margin-top:0px"><asp:Image ID="imgRight" runat="server" ImageUrl="~/
    Images/TopRight.PNG"/></th>
    </tr>
    </table>



    -----Original Message-----
    From: cfps.Christian [mailto:]
    Posted At: Tuesday, November 27, 2007 12:08 PM
    Posted To: microsoft.public.dotnet.framework.aspnet
    Conversation: Unexplained Whitespace
    Subject: Unexplained Whitespace

    I'm not too terribly efficient in HTML or ASP.NET but I know enough to
    get into trouble

    <table id="tblImgAlign" runat="server" width="100%" cellspacing="0"
    style="border-style:none" cellpadding="0">
    <tr>
    <th style="width:179px; border-style:none">
    <asp:Image ID="imgLeft" runat="server" ImageUrl="~/
    Images/TopLeft.PNG"/>
    </th>
    <th style="background-image:url(/Images/TopCenter.PNG);
    background-repeat:repeat-x; border-style:none">
    <asp:Label ID="lblHeader" runat="server"
    Text="Testimony Apparel" />
    </th>
    <th style="width:217px; border-style:none; margin-top:0px">
    <asp:Image ID="imgRight" runat="server" ImageUrl="~/
    Images/TopRight.PNG"/>
    </th>
    </tr>
    </table>

    The final image has a chunk of whitespace right above it which is
    preventing the 3 images from lining up. If anyone has any ideas on
    what could be causing it please tell me.

    I've tried the margins, imagealign, and a few other things that are
    simple.

    The Source also leaves the whitespace unexplained.
     
    Dave Bush, Nov 27, 2007
    #2
    1. Advertising

  3. On Nov 27, 12:52 pm, "Dave Bush" wrote:
    > The tab character, newline character, and linefeed characters all count
    > as a space in html. They only show as one space, but they all count.
    >
    > This is esp. a problem with images, as you've seen. To get around it,
    > you want to have all of your ending brackets touching your beginning
    > brackets in the area where your images are.
    >
    > <table id="tblImgAlign" runat="server" width="100%" cellspacing="0"
    > style="border-style:none" cellpadding="0">
    > <tr>
    > <th style="width:179px; border-style:none"><asp:Image
    > ID="imgLeft" runat="server" ImageUrl="~/
    > Images/TopLeft.PNG"/></th>
    > <th style="background-image:url(/Images/TopCenter.PNG);
    > background-repeat:repeat-x; border-style:none">
    > <asp:Label ID="lblHeader" runat="server"
    > Text="Testimony Apparel" />
    > </th>
    > <th style="width:217px; border-style:none;
    > margin-top:0px"><asp:Image ID="imgRight" runat="server" ImageUrl="~/
    > Images/TopRight.PNG"/></th>
    > </tr>
    > </table>
    >
    > -----Original Message-----
    > From: cfps.Christian [mailto:]
    >
    > Posted At: Tuesday, November 27, 2007 12:08 PM
    > Posted To: microsoft.public.dotnet.framework.aspnet
    > Conversation: Unexplained Whitespace
    > Subject: Unexplained Whitespace
    >
    > I'm not too terribly efficient in HTML or ASP.NET but I know enough to
    > get into trouble
    >
    > <table id="tblImgAlign" runat="server" width="100%" cellspacing="0"
    > style="border-style:none" cellpadding="0">
    > <tr>
    > <th style="width:179px; border-style:none">
    > <asp:Image ID="imgLeft" runat="server" ImageUrl="~/
    > Images/TopLeft.PNG"/>
    > </th>
    > <th style="background-image:url(/Images/TopCenter.PNG);
    > background-repeat:repeat-x; border-style:none">
    > <asp:Label ID="lblHeader" runat="server"
    > Text="Testimony Apparel" />
    > </th>
    > <th style="width:217px; border-style:none; margin-top:0px">
    > <asp:Image ID="imgRight" runat="server" ImageUrl="~/
    > Images/TopRight.PNG"/>
    > </th>
    > </tr>
    > </table>
    >
    > The final image has a chunk of whitespace right above it which is
    > preventing the 3 images from lining up. If anyone has any ideas on
    > what could be causing it please tell me.
    >
    > I've tried the margins, imagealign, and a few other things that are
    > simple.
    >
    > The Source also leaves the whitespace unexplained.


    I just tried that and it didn't work. I'm not sure how I solved this
    problem before but it consisted of rewriting something and
    unfortunately this is the rewrite.
     
    cfps.Christian, Nov 27, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michiel

    NEWBIE:unexplained syntax error

    Michiel, Sep 9, 2004, in forum: Perl
    Replies:
    2
    Views:
    507
    Barry Kimelman
    Sep 10, 2004
  2. Marty Cruise

    Unexplained Instance Error

    Marty Cruise, Jul 3, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    405
    David Waz..
    Jul 3, 2003
  3. Oli Filth
    Replies:
    9
    Views:
    3,333
    Uncle Pirate
    Jan 17, 2005
  4. Replies:
    10
    Views:
    748
    Eric Brunel
    Dec 16, 2008
  5. MRAB
    Replies:
    3
    Views:
    390
Loading...

Share This Page