为什么html标签中只有table的width属性才包含border?


<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        body{margin:0;padding:0}
        table{border-collapse:collapse;border:5px solid #f00;width:200px;height:200px;}
        td{border:5px solid #00f;width:20px}
    </style>
</head>
<body>
    <table>
        <tr>
            <td>test</td>
            <td>test</td>
        </tr><tr>
            <td>test</td>
            <td>test</td>
        </tr><tr>
            <td>test</td>
            <td>test</td>

        </tr>
    </table>
</body>
</html>

border HTML table

Koolee 11 years, 3 months ago

我想,这是为了减少计算而故意设计的吧。

偶是UP主马甲 answered 11 years, 3 months ago

Your Answer