css+div实现table布局
css代码
<style>
.table/*div table container*/
{


/*width:770px;*/
}
.row div/*div row cell*/
{
display:inline;
width:240px;
border-top:1px solid #C1BBAB;
border-left:1px solid #C1BBAB;
}
.header div/*div header cell*/
{
display:inline;
width:240px;
border-top:1px solid #C1BBAB;
border-left:1px solid #C1BBAB;
text-align:center;
background-color:#E0DDD5;
}
.lastcell/*last cell*/
{
border-right:1px solid #C1BBAB;
}
.header/*div table hearder*/
{
font:bold;
color:navy;
}
.grid_rw1clr div/*cell in grid_rw1clr*/
{
background-color: #FFFFFF;
}
.grid_rw2clr div/*cell in grid_rw1clr*/
{
background-color: #F9F8F6;
}
.row
{
font:normal 12px;
}
.lastrow div/*cell in last row*/
{
border-bottom:1px solid #C1BBAB;
}
</style>class:grid_rw1clr,grid_rw2clr实现交替色
Css Table效果
header(1,1)
header(1,2)
row(1,1)
row(1,2)
row(2,1)
row(2,2)
<div class="table">
<div class="header"><div>header(1,1)</div><div class="lastcell">header(1,2)</div></div>
<div class="row grid_rw1clr"><div>row(1,1)</div><div class="lastcell">row(1,2)</div></div>
<div class="row grid_rw2clr lastrow"><div>row(2,1)</div><div class="lastcell">row(2,2)</div></div>
</div>接下来还需要实现:
- 排序
- 拖拽
- 拉伸
.table

浙公网安备 33010602011771号