2010-03-15 37 views

回答

2

我通常会创建一个包含div(模拟表行),然后为特定列(模拟表数据)分区。

<div class="container"> 
    <div class="left-column column"></div> 
    <div class="right-column column"></div> 
</div> 

然后使相对定位在容器:该容器内

.container { position: relative } 

这允许绝对定位元素。然后,我们可以使用一些绝对定位的好处伸展列的div:

.column { position: absolute; top: 0; bottom: 0; } 

然后,你会希望把左边的左边的列和右侧的右列:

.left-column { left: 0; } 
.right-column { right: 0; } 

其他(造型)取决于你,我认为应该这样做。

编辑:证据的概念

我写的概念代码证明了这一点,如下所示:

<html> 
    <head> 

     <style type="text/css"> 
      .container { height: 200px; width: 200px; position: relative; border: 5px solid red; } 
      .left-column { width: 100px; background-color: blue; left: 0; } 
      .right-column { width: 100px; background-color: yellow; right: 0; } 
      .column { position: absolute; top: 0; bottom: 0; } 
     </style> 

    </head> 
    <body> 
     <div class="container"> 
      <div class="left-column column"></div> 
      <div class="right-column column"></div> 
     </div> 
    </body> 
</html> 

这使得为:

alt text

我希望帮助。

+1

我期待一个表与CSS轩然大波! – tahdhaze09 2010-03-17 20:25:09

相关问题