如果外面的宽度为600 看li有几列 然后在加1 为外面的总宽度。li的总宽度 为600-li的个数+1
<html>
<head>
<title>test</title>
<style type="text/css">
ul{
margin:0px;
padding:0px;
width:200px;
}
li{
float:left;
list-style-type:none;
border-top:#000 solid 1px;
border-left:#000 solid 1px;
width:65px;
}
.border-r{
border-right:#000 solid 1px;
}
.border-b{
border-bottom:#000 solid 1px;
}
.border-l{
border-right:#000 solid 1px;
border-bottom:#000 solid 1px;
}
</style>
</head>
<body>
<div>
<ul>
<li>1</li>
<li>&2;</li>
<li class="border-r">&3;</li>
</ul>
<ul>
<li>&1;</li>
<li>&2;</li>
<li class="border-r">&3;</li>
</ul>
<ul>
<li>&1;</li>
<li>&2;</li>
<li class="border-r">&3;</li>
</ul>
<ul>
<li class="border-b">&1;</li>
<li class="border-b">&2;</li>
<li class="border-l">&3;</li>
</ul>
</div>
</body>
</html>
<head>
<title>test</title>
<style type="text/css">
ul{
margin:0px;
padding:0px;
width:200px;
}
li{
float:left;
list-style-type:none;
border-top:#000 solid 1px;
border-left:#000 solid 1px;
width:65px;
}
.border-r{
border-right:#000 solid 1px;
}
.border-b{
border-bottom:#000 solid 1px;
}
.border-l{
border-right:#000 solid 1px;
border-bottom:#000 solid 1px;
}
</style>
</head>
<body>
<div>
<ul>
<li>1</li>
<li>&2;</li>
<li class="border-r">&3;</li>
</ul>
<ul>
<li>&1;</li>
<li>&2;</li>
<li class="border-r">&3;</li>
</ul>
<ul>
<li>&1;</li>
<li>&2;</li>
<li class="border-r">&3;</li>
</ul>
<ul>
<li class="border-b">&1;</li>
<li class="border-b">&2;</li>
<li class="border-l">&3;</li>
</ul>
</div>
</body>
</html>
<html>
<head>
<style>
* {
margin:0;
padding:0;
font-size:12px;
color:#000;
}
#biaoge {
width:405px;
margin:50px auto;
}
#biaoge li,#biaoge li.biaotou {
list-style-type:none;
width:100px;
height:30px;
line-height:30px;
text-align:center;
float:left;
margin-left:1px;
margin-bottom:1px;
background:#ccc;
}
#biaoge li.biaotou {
background:#999;
}
</style>
</head>
<body>
<ul id="biaoge">
<li class="biaotou">第一列</li>
<li class="biaotou">第二列</li>
<li class="biaotou">第三列</li>
<li class="biaotou">第四列</li>
<li>数据1-1</li>
<li>数据1-2</li>
<li>数据1-3</li>
<li>数据1-4</li>
<li>数据2-1</li>
<li>数据2-2</li>
<li>数据2-3</li>
<li>数据2-4</li>
</ul>
</body>
</html>
<head>
<style>
* {
margin:0;
padding:0;
font-size:12px;
color:#000;
}
#biaoge {
width:405px;
margin:50px auto;
}
#biaoge li,#biaoge li.biaotou {
list-style-type:none;
width:100px;
height:30px;
line-height:30px;
text-align:center;
float:left;
margin-left:1px;
margin-bottom:1px;
background:#ccc;
}
#biaoge li.biaotou {
background:#999;
}
</style>
</head>
<body>
<ul id="biaoge">
<li class="biaotou">第一列</li>
<li class="biaotou">第二列</li>
<li class="biaotou">第三列</li>
<li class="biaotou">第四列</li>
<li>数据1-1</li>
<li>数据1-2</li>
<li>数据1-3</li>
<li>数据1-4</li>
<li>数据2-1</li>
<li>数据2-2</li>
<li>数据2-3</li>
<li>数据2-4</li>
</ul>
</body>
</html>