zoukankan      html  css  js  c++  java
  • 上下两个表格之间为什么中间会有大约5象素的间距?

    今天发现一个问题:上下两个表格中间有大约5象素的间距。
    代码是这样的

    <!--head-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/head.gif"></td>
                </tr>
            </table>
        </div>
        <!--end head-->
        <!--menu-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/menu_1.gif" width="8" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_2.gif" width="668" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_3.gif" width="13" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_4.gif" width="67" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_5.gif" width="22" height="37" alt=""></td>
                </tr>
            </table>
        </div>
        <!--end menu-->

    最后经过调试,终于发现是因为head中image的宽度和高度没有设定。改成下面的代码即可。

    <!--head-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/head.gif" width="778" height="98" alt=""></td>
                </tr>
            </table>
        </div>
        <!--end head-->
        <!--menu-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/menu_1.gif" width="8" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_2.gif" width="668" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_3.gif" width="13" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_4.gif" width="67" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_5.gif" width="22" height="37" alt=""></td>
                </tr>
            </table>
        </div>
        <!--end menu-->

    如果还有间隔的话,把<td><img src="" width="" height=""></td> 中间不要留空格。

  • 相关阅读:
    js总结:增加和减少文本框
    java总结:字符串切割
    Spring-----ioc
    Hibernate之二级缓存
    Hibernate之HQL
    Hibernate关联关系(一对多自关联 ,多对多)
    Hibernate关联关系(一对多)
    Hibernate之主键生成策略
    如何使用hibernate完成CRUD操作
    Struts2-----文件上传与拦截器原理
  • 原文地址:https://www.cnblogs.com/ami/p/455768.html
Copyright © 2011-2022 走看看