Eliminate gap between table rows?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce W...1

    Eliminate gap between table rows?

    I made my first PHP page that uses includes.

    But I can't get rid of a gap (about 5 pixels) between the table rows.

    The content of each include file is one line like this:
    <img src="images/nav.gif" width="100" height="600" hspace="0"
    vspace="0" border="0">
    No head or body tags. Just a 100 x 600 gif image.

    Here's the code for the main.php page:

    <html>
    <head>
    <title>First Include Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 ">
    <table width="600px" border="0" align="center" cellpadding="0"
    cellspacing="0" >
    <tr>
    <td colspan="2"><?p hp include 'header.php' ?>
    </td>
    </tr>
    <tr>
    <td><?php include 'nav.php' ?></td>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
    <td>This is the content area.</td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td colspan="2"><?p hp include 'footer.php' ?></td>
    </tr>
    </table>
    </body>
    </html>

    If you look at the main page in IE there is a vertical gap between the
    header, nav, and footer image. Does anyone know how to get rid of this?

    Thanks for your help.
  • Benjamin Esham

    #2
    Re: Eliminate gap between table rows?

    * "Bruce W...1" <bruce@noDirect Email.com>:
    [color=blue]
    > I made my first PHP page that uses includes. But I can't get rid of a
    > gap (about 5 pixels) between the table rows. [...] If you look at the
    > main page in IE there is a vertical gap between the header, nav, and
    > footer image. Does anyone know how to get rid of this?[/color]

    I realize that this isn't all that helpful, but... I looked at this page
    using Mac OS X and Safari 1.0, Camino 0.7 (basically Mozilla ~1.2 for
    purposes of rendering, I believe), and Internet Explorer 5.2.1, and it
    looked fine. Perhaps a more cross-platform approach (such as CSS) would
    work better?

    --
    Benjamin D. Esham { http://bdesham.net
    bdesham@iname.c om } AIM: bdesham 1 2 8
    Esperanto, the international language -- lernu.net

    Comment

    • Peter Taurins

      #3
      Re: Eliminate gap between table rows?

      Yep.

      <td colspan="2"><?p hp include 'header.php' ?>
      </td>

      and here:

      <td><img src="images/nav.gif" width="100" height="600" hspace="0"
      vspace="0" border="0">

      </td>


      When you page is rendered the </td> is on a different line and your browser
      is interpreting this to insert an additional space.
      Make sure your </td> is on the same line as the <td> and therefore the space
      is not there and it should render properly.

      PWT.


      "Bruce W...1" <bruce@noDirect Email.com> wrote in message
      news:3F6A2DC2.B D50FE3E@noDirec tEmail.com...[color=blue]
      > I made my first PHP page that uses includes.
      > http://php.didah.com/main.php
      > But I can't get rid of a gap (about 5 pixels) between the table rows.
      >
      > The content of each include file is one line like this:
      > <img src="images/nav.gif" width="100" height="600" hspace="0"
      > vspace="0" border="0">
      > No head or body tags. Just a 100 x 600 gif image.
      >
      > Here's the code for the main.php page:
      >
      > <html>
      > <head>
      > <title>First Include Page</title>
      > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      > </head>
      > <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 ">
      > <table width="600px" border="0" align="center" cellpadding="0"
      > cellspacing="0" >
      > <tr>
      > <td colspan="2"><?p hp include 'header.php' ?>
      > </td>
      > </tr>
      > <tr>
      > <td><?php include 'nav.php' ?></td>
      > <td><table width="100%" border="0" cellspacing="0" cellpadding="0" >
      > <tr>
      > <td>This is the content area.</td>
      > </tr>
      > </table></td>
      > </tr>
      > <tr>
      > <td colspan="2"><?p hp include 'footer.php' ?></td>
      > </tr>
      > </table>
      > </body>
      > </html>
      >
      > If you look at the main page in IE there is a vertical gap between the
      > header, nav, and footer image. Does anyone know how to get rid of this?
      >
      > Thanks for your help.[/color]


      Comment

      • Bruce W...1

        #4
        Re: Eliminate gap between table rows?

        Peter Taurins wrote:[color=blue]
        >
        > Yep.
        >
        > <td colspan="2"><?p hp include 'header.php' ?>
        > </td>
        >
        > and here:
        >
        > <td><img src="images/nav.gif" width="100" height="600" hspace="0"
        > vspace="0" border="0">
        >
        > </td>
        >
        > When you page is rendered the </td> is on a different line and your browser
        > is interpreting this to insert an additional space.
        > Make sure your </td> is on the same line as the <td> and therefore the space
        > is not there and it should render properly.
        >
        > PWT.
        >[/color]
        =============== =============== =============== ==

        I'll buy your explanation. That's what's being served. But this is
        getting wierd because that is not what's in my source file.

        I made sure of this and uploaded it again:


        I copied the source to here below.

        It does the same thing on my local PC.

        This tells me that the PHP parser is inserting these spaces. Why would
        it do that?



        Source
        -------------------------
        <html>
        <head>
        <title>First Include Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        </head>

        <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 ">
        <table width="600px" border="0" align="center" cellpadding="0"
        cellspacing="0" >
        <tr>
        <td colspan="2"><?p hp include 'header.php' ?></td>
        </tr>
        <tr>
        <td><?php include 'nav.php' ?></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0" >
        <tr>
        <td>This is the content area.</td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td colspan="2"><?p hp include 'footer.php' ?></td>
        </tr>
        </table>
        </body>
        </html>

        Comment

        • Bruce W...1

          #5
          Re: Eliminate gap between table rows?

          Benjamin Esham wrote:[color=blue]
          >
          > * "Bruce W...1" <bruce@noDirect Email.com>:
          >[color=green]
          > > I made my first PHP page that uses includes. But I can't get rid of a
          > > gap (about 5 pixels) between the table rows. [...] If you look at the
          > > main page in IE there is a vertical gap between the header, nav, and
          > > footer image. Does anyone know how to get rid of this?[/color]
          >
          > I realize that this isn't all that helpful, but... I looked at this page
          > using Mac OS X and Safari 1.0, Camino 0.7 (basically Mozilla ~1.2 for
          > purposes of rendering, I believe), and Internet Explorer 5.2.1, and it
          > looked fine. Perhaps a more cross-platform approach (such as CSS) would
          > work better?
          >
          > --
          > Benjamin D. Esham { http://bdesham.net
          > bdesham@iname.c om } AIM: bdesham 1 2 8
          > Esperanto, the international language -- lernu.net[/color]

          =============== =============== =============== ==

          Thanks, that's reassuring, for everything but IE.

          Comment

          • Peter Taurins

            #6
            Re: Eliminate gap between table rows?

            In your included components you actually have a few blank lines after the:

            <img src="images/head.gif" width="600" height="100" vspace="0" border="0">

            These blank lines are being sent to the HTML which is adding them in before
            the </td> thus pushing your </td> to a new line, effetivelu inserting a
            space.

            Edit your included components and make sure there is NOTHING after the
            closing tag.

            This should then work.

            HTH.
            PWT.


            "Bruce W...1" <bruce@noDirect Email.com> wrote in message
            news:3F6A48AD.A CC4BE4B@noDirec tEmail.com...[color=blue]
            > Peter Taurins wrote:[color=green]
            > >
            > > Yep.
            > >
            > > <td colspan="2"><?p hp include 'header.php' ?>
            > > </td>
            > >
            > > and here:
            > >
            > > <td><img src="images/nav.gif" width="100" height="600" hspace="0"
            > > vspace="0" border="0">
            > >
            > > </td>
            > >
            > > When you page is rendered the </td> is on a different line and your[/color][/color]
            browser[color=blue][color=green]
            > > is interpreting this to insert an additional space.
            > > Make sure your </td> is on the same line as the <td> and therefore the[/color][/color]
            space[color=blue][color=green]
            > > is not there and it should render properly.
            > >
            > > PWT.
            > >[/color]
            > =============== =============== =============== ==
            >
            > I'll buy your explanation. That's what's being served. But this is
            > getting wierd because that is not what's in my source file.
            >
            > I made sure of this and uploaded it again:
            > http://php.didah.com/main.php
            >
            > I copied the source to here below.
            >
            > It does the same thing on my local PC.
            >
            > This tells me that the PHP parser is inserting these spaces. Why would
            > it do that?
            >
            >
            >
            > Source
            > -------------------------
            > <html>
            > <head>
            > <title>First Include Page</title>
            > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            > </head>
            >
            > <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 ">
            > <table width="600px" border="0" align="center" cellpadding="0"
            > cellspacing="0" >
            > <tr>
            > <td colspan="2"><?p hp include 'header.php' ?></td>
            > </tr>
            > <tr>
            > <td><?php include 'nav.php' ?></td>
            > <td><table width="100%" border="0" cellspacing="0" cellpadding="0" >
            > <tr>
            > <td>This is the content area.</td>
            > </tr>
            > </table></td>
            > </tr>
            > <tr>
            > <td colspan="2"><?p hp include 'footer.php' ?></td>
            > </tr>
            > </table>
            > </body>
            > </html>[/color]


            Comment

            • Warren Oates

              #7
              Re: Eliminate gap between table rows?

              In article <3F6A2DC2.BD50F E3E@noDirectEma il.com>,
              "Bruce W...1" <bruce@noDirect Email.com> wrote:

              : If you look at the main page in IE there is a vertical gap between the
              : header, nav, and footer image. Does anyone know how to get rid of this?

              On my Mac, in IE 5.1.7 (Mac OS-9), the gap isn't there, but on the same
              machine, with Mozilla it shows. Someone else mentioned CSS -- you might
              have to do something with that, akin to the "margin" thing you've done
              in your <body> tag. You know, you can just say <body style="margin: 0">
              to quickly achieve the same result.
              --
              Looks like more of Texas to me.
              .... Arizona, where the nights are warm and the roads are straight.

              Comment

              • Bruce W...1

                #8
                Re: Eliminate gap between table rows?

                Peter Taurins wrote:[color=blue]
                >
                > In your included components you actually have a few blank lines after the:
                >
                > <img src="images/head.gif" width="600" height="100" vspace="0" border="0">
                >
                > These blank lines are being sent to the HTML which is adding them in before
                > the </td> thus pushing your </td> to a new line, effetivelu inserting a
                > space.
                >
                > Edit your included components and make sure there is NOTHING after the
                > closing tag.
                >
                > This should then work.
                >
                > HTH.
                > PWT.
                >[/color]
                =============== =============== =============== ==========

                By jove you've got it. I appreciate your help, I would have never have
                guessed this. Thanks.

                Comment

                Working...