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

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

问题描述

我正在尝试使用各种 php 组织的简单页面,包括内表.

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

我的问题是:当我将 放在 <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?

推荐答案

当我查看您的测试站点并下载源代码时,在 之后和内容之前插入了不可见字符您包含的文件.我复制到 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.

附加信息:

用于调试的工具:

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

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