使用TABLES和INCLUDES [英] Using TABLES and INCLUDES

查看:152
本文介绍了使用TABLES和INCLUDES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用包含内部表格的各种php组织的简单页面。

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

我的问题是:当我输入< ;?php包含('header.php');?> < td> 表中,它们之间创建了一个空格。

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

这是我要做的测试页面: http://www.dmaispublicidade.pt/_dmaisprojecto

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

是一个index.php,其中一个表调用其他.php文件(甚至有表格)和其他包括)?

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!

有人可以帮忙吗?

index.php示例:

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>

header.php示例:

Example of header.php:

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

css的示例(在index.php的头部内部调用):

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;
}

当我们在测试页面中看到源代码时,我们可以看到在文件中插入(我不知道如何)TBODY;我不知道为什么。有什么可以通过CSS删除TBODY吗?

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?

推荐答案

当我查看您的测试网站并下载了源代码时,会有不可见的字符在< td> 之后和所包含文件的内容之前插入。我复制到Notepad ++并且必须更改为ANSI编码才能看到它。我会打开您正在使用的任何编辑器中查看所有字符,看看是否可以找到要删除的可见字符。

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.

使用十六进制编辑器我发现你的文件是用带有BOM的UTF-8编码的。此字节顺序标记字符导致显示问题。谷歌搜索发现W3C有一个文章,涵盖了这个和如何从文件中删除BOM字符。

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.

其他信息:

  • What's different between UTF-8 and UTF-8 without BOM?

用于调试的工具:

  • FireBug
  • Notepad++
  • Fiddler2

这篇关于使用TABLES和INCLUDES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆