+ -
当前位置:首页 → 问答吧 → 求教如何去除table每行之间的空白间隙?

求教如何去除table每行之间的空白间隙?

时间:2011-10-29

来源:互联网

HTML code
<!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>
        <meta http-equiv="Content-Type" content="text/html; charset=GB2312"/>
        <title>test table border</title>
        <style type="text/css">
            table{
                border:0;
                cellspacing:0;
                cellpadding:0;
            }
            
            table tr{
                border:none;
                padding:0;
                margin:0;
            }

            table td{
                background:#cccc99;
                border-bottom:3px solid red;
                border-top:3px solid blue;
                margin:0;
                padding:7px;
            }

            table td:hover{
                background:#ccdd00;
                cursor:pointer;
            }

        </style>

    </head>

    <body>
        <table id="text">
            <tr>
                <td>This is kongkongde</td>
                <td>This is kongkongde</td>
                <td>This is kongkongde</td>
            </tr>
            <tr>
                <td>This is kongkongde</td>
                <td>This is kongkongde</td>
                <td>This is kongkongde</td>
            </tr>
            <tr>
                <td>This is kongkongde</td>
                <td>This is kongkongde</td>
                <td>This is kongkongde</td>
            </tr>
        </table>
    </body>
</html>


不能上传图片。
请问如何将表格行之间的空白去除啊?
谢谢!

作者: qingumiyin   发布时间: 2011-10-29

<table id="text" cellspacing=0 cellpadding=0>
这些属性不能写在css里面的

作者: net_lover   发布时间: 2011-10-29