469,366 Members | 2,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

Eliminate gap between table rows?

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"><?php 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"><?php 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.
Jul 17 '05 #1
7 15811
* "Bruce W...1" <br***@noDirectEmail.com>:
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?


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
bd*****@iname.com } AIM: bdesham 1 2 8
Esperanto, the international language -- lernu.net

Jul 17 '05 #2
Yep.

<td colspan="2"><?php 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" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
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"><?php 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"><?php 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.

Jul 17 '05 #3
Peter Taurins wrote:

Yep.

<td colspan="2"><?php 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.

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

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"><?php 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"><?php include 'footer.php' ?></td>
</tr>
</table>
</body>
</html>
Jul 17 '05 #4
Benjamin Esham wrote:

* "Bruce W...1" <br***@noDirectEmail.com>:
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?


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
bd*****@iname.com } AIM: bdesham 1 2 8
Esperanto, the international language -- lernu.net


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

Thanks, that's reassuring, for everything but IE.
Jul 17 '05 #5
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" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
Peter Taurins wrote:

Yep.

<td colspan="2"><?php 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.

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

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"><?php 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"><?php include 'footer.php' ?></td>
</tr>
</table>
</body>
</html>

Jul 17 '05 #6
In article <3F***************@noDirectEmail.com>,
"Bruce W...1" <br***@noDirectEmail.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.
Jul 17 '05 #7
Peter Taurins wrote:

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.

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

By jove you've got it. I appreciate your help, I would have never have
guessed this. Thanks.
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Julio Allegue | last post: by
4 posts views Thread by jeffsal | last post: by
7 posts views Thread by Richard Yardley | last post: by
1 post views Thread by VM | last post: by
7 posts views Thread by Kamal | last post: by
5 posts views Thread by jrod11 | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.