我有一个div-table,它可以很好地处理大约4列,但现在我想让这些项可扩展,这样条目下面就会出现另一个div。问题是,如果我在table-row下面使用另一个div,那么它的宽度就会被塞到第一列的宽度。
我需要的是一个忽略表布局的划分..有什么好的解决方案吗?
发布于 2012-09-06 16:51:14
看起来你最后在底部生成的div从你的divTable类继承了一些奇怪的东西。在您的代码中,最终的div位于divTable的包装器中。我稍微修改了您的代码,使divTable在div之外,它跨越了所有列。
<div class="navContent">
<div id="lastRequests" class="divTable">
<div class="divRow bold">
<div class="divCell c1"> SiteID </div>
<div class="divCell c2"> Ort </div>
<div class="divCell c3"> Anfrage </div>
<div class="divCell c4"> Ergebnis </div>
<div class="divCell c5"> Datum </div>
</div>
<div class="divRow">
<div class="divCell c1"> 56831-12481 </div>
<div class="divCell c2"> gütersloh </div>
<div class="divCell c3"> 332312, Bielefeld, <span class="tooltip" data-tooltip="Open. Web. Business.">Deutscheland</span>, 80.32, 43.23</div>
<div class="divCell c4"> Proxy </div>
<div class="divCell c5"> 05.09.2012 20:20:21 </div>
</div>
</div>
<!-- move this div here -->
<div style="background-color: #0F9;">
This div should use the whole width
</div>
</div>编辑:虽然这是可行的,但我同意上面的所有人所说的,你真的应该只为这些数据使用表,而不是试图用div复制表的功能。
发布于 2012-09-06 16:49:24
据我所知,CSS没有使用colspan属性显示div的选项。
如果要显示实际的表格数据,我建议使用真正的table元素,或者简单地使用div重新创建布局,其中包含table属性和您自己的自定义样式。
https://stackoverflow.com/questions/12295439
复制相似问题