急,请问css中table相关设置问题?

来源:百度知道 编辑:UC知道 时间:2024/06/30 23:31:19
急,请问css中table相关设置问题?

请问把下面这段代码写在css的<style></style>之间要怎么整?
<table border=1 width=100 height=200 cellpadding=0 cellspacing=0 bordercolordark=white bordercolorlight=black>

我写了个根本就不行.
<style type="text/css">
table{
border=1;
width=100;
height=200;
cellpadding=0;
cellspacing=0;
bordercolordark=white;
bordercolorlight=black;
</style>

你写的根本就不是css中table支持的元素哦
语法也不对 ,css中是根本没有 = 的
我写了个尽量类似的 你看看效果如何

<html>
<head>
<title>table test</title>
<style type="text/css">
#layout, #layout td {
border: 1px solid black;
width: 100px;
height: 200px;
border-collapse : collapse;
}
</style>
</head>
<body>
<table id="layout">
<tr><td>test1</td><td>test2</td></tr>
</table>
</body>
</html>

css不能这么写的。
<style type="text/css">
table{
border:1px solid #000;
width:100px;
height:200px;
border-collapse : collapse;
background-color:#fff;
}
</style>

看看区别又多大