0

I'm trying to to a simple page organized with various php includes inside tables.

My problem is: when I put a <?php include('header.php');?> in <td>of the tables it creates a space between them.

Here is the test page that I'm trying to do: http://www.dmaispublicidade.pt/_dmaisprojecto

Is an index.php with a table calling others .php files (that even have tables and other includes)?

This white spaces between images it is supposed to not be there!

Can anybody help?

Example of index.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>d+ projecto</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="css/estilos.css" rel="stylesheet" type="text/css">
    </head>
    <body><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr align="center">
                <td><?php include('header.php'); ?></td>
            </tr>
            <tr align="center">
                <td><?php include('corpo.php'); ?></td>
            </tr>
            <tr align="center">
                <td><?php include('footer.php'); ?></td>
            </tr>
        </table>
    </body>
</html>

Example of header.php:

<table width="950" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td><img src="imagens/provisorio/header.jpg"/></td>
    </tr>
</table>

Example of the css (that is called inside the head of index.php):

@charset "utf-8";
body {
    margin: 0px;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}

When we saw the source code in the test page, we can saw that is inserting (I don't know how) a TBODY in the document; I don't know why. There is something to remove the TBODY by CSS?

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
Marcelo
  • 3
  • 3

2 Answers2

0

Try removing the:

<!----------------------  MENU  ---------------------->

which is adding an extra (non) element to the document.

ADW
  • 3,980
  • 15
  • 13
0

When I viewed your test site and downloaded the source, there are invisible characters inserted after the <td> and before the contents of your included file. I copied into Notepad++ and had to change to ANSI encoding to even see it. I would turn on view all characters in whatever editor you are using and see if you can find the visible characters to remove.

Update:

Using a hex editor I've found that your files are encoded with UTF-8 with BOM. This Byte order mark character is causing the display issue. Googling found that W3C has an article covering this and how to remove the BOM character from your files.

Additional Info:

Tools used to debug:

Community
  • 1
  • 1
Paul DelRe
  • 3,845
  • 1
  • 21
  • 25
  • yes i saw it too :( but that code is not in my files. ... do u know how to fix that? thks. – Marcelo May 06 '11 at 18:54
  • Is inserting a TBODY in the documento :S i dont know why. There is someting to remove the TBODY by CSS? – Marcelo May 06 '11 at 19:05
  • THIS UR POST UPDATE WORKS!!! - Thank u!! The problem was the BOM ... all php files was with UTF-8 BOM (except index.php) .... Now is all without.it. Thanks a lot!! Regards. – Marcelo May 06 '11 at 22:39