Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS:使所有列的高度相同,即使不同的c_Html_Css - Fatal编程技术网

Html CSS:使所有列的高度相同,即使不同的c

Html CSS:使所有列的高度相同,即使不同的c,html,css,Html,Css,使用表格来实现这一点,简单得多,而且不需要破解 Col1 Col2 Col3 **************************** | | | | | | | | | | | | | | | | | | | | | | |

使用表格来实现这一点,简单得多,而且不需要破解

  Col1      Col2     Col3
****************************
|        |        |        |
|        |        |        |
|        |        |        |
|        |        |        |
|        |        |        |
|        |        |        |
****************************

第1列
第2列
第3列
表单元格
表单元格
表单元格

如果您不关心ie7支持,您可以将当前的html与

<table border="1" cellpadding="3" cellspacing="3">
    <thead>
        <tr>
            <td>Col 1</td>
            <td>Col 2</td>
            <td>Col 3</td>  
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Table Cell</td>
            <td>Table Cell</td>
            <td>Table Cell</td>
        </tr>
    </tbody>
</table>
理想情况下,您可以将代码包装在另一个div中,并使用display:table;并显示:表格行


示例:

以下是您可能正在寻找的内容,类似于chris的答案

HTML:


下面是一个要测试的动态JSFIDLE文件()

您可能想使用HTML表:为什么不使用始终保持所有COLLMN高度相同的HTML表?
<table border="1" cellpadding="3" cellspacing="3">
    <thead>
        <tr>
            <td>Col 1</td>
            <td>Col 2</td>
            <td>Col 3</td>  
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Table Cell</td>
            <td>Table Cell</td>
            <td>Table Cell</td>
        </tr>
    </tbody>
</table>
#row1 div { 
display:table-cell; 
width:200px; 
padding:0 15px; 
border:1px solid #efefef;
}
<div id="container">
    <div class="column">column 1</div>
    <div class="column">column 2</div>
    <div class="column">column 3</div>
</div>
#container {
    display: table;
    position: absolute;
    width: 960px;
    border: 1px solid #000;
    padding: 5px 5px 5px 5px;
}
.column, .column, .column {
    display: table-cell;
    text-align: center;
    width: 310px;
    border: 1px solid #000;
}