简体   繁体   English

如何使用HTML5,CSS3删除列中的空白

[英]How to remove empty spaces in the columns using HTML5, CSS3

在此处输入图片说明 There are multiple columns in which the data would be fetched dynamically. 在多个列中,将动态获取数据。 So the column which have more data would take the complete height. 因此,具有更多数据的列将占据整个高度。 The other columns in the same row, would also consume the maximum height (even though they don't have much data) So, there would be empty space left.How do i remove this empty space. 同一行中的其他列也将占用最大高度(即使它们没有太多数据)因此,将剩下空白空间。如何删除此空白空间。

 <td style="text-align: center;height:100%;">
 <table style="border-collapse:collapse; margin: -6px -14px -7px -11px; 
width:100%;height:100%;>
<tr>
    <td style="height:100%;" >
        <table  style="width:100%;height:100%" ><tr > 
            <td height="100%" ng-repeat="--">
                -- multiple div and span blocks used to loop multiple times- 
        </td></tr></table>

the only way i know to have "not aligned" cell separations in a table is to use colspan and rowspan , but these functionalities can only fuse cells together, not create an isolated cell (isolated in the sense that it would have it's own dimensioning despite the row or column it corresponds). 我知道在表格中具有“未对齐”单元格分隔的唯一方法是使用colspanrowspan ,但是这些功能只能将单元格融合在一起,而不能创建隔离的单元格(在某种意义上是隔离的,尽管对应的行或列)。

If in theory your layout could be possible with a table , it would involve a lot of code to have these cell fusions OK and probably need javascript for the dimensioning. 如果从理论上讲,您可以使用table进行布局,则将需要很多代码才能使这些单元格融合正常,并且可能需要使用javascript进行标注。

example with rowspan: rowpan的示例:

 <table border="1"> <tr> <td rowspan="2">A</td><td>B</td><td>C</td> </tr> <tr> <td rowspan="2">B</td><td>C</td> </tr> <tr> <td>A</td><td>C</td> </tr> </table> 

In conclusion , your layout would be much more easily done with div and eventually wrapper divs if you want to emulate rows or columns. 总之 ,如果要模拟行或列,则使用div以及最终包装div可以更轻松地完成布局。 This will also be quicker to render, table is nowadays considered a bad choice to organize a layout. 这也将更快地渲染,现在认为table是组织布局的一个坏选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM