3

I have the following scenario, where I have a table that is to take up 100% height:

<table class="table1">
    <tr>
        <td class="fixed">
            Fixed height row
        </td>
    </tr>
    <tr>
        <td>
            <table class="table2"> 
                <tr>
                    <td>
                        Content
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

Inside the table cell I have some other element that I want to fill the parent table cell height (100%).

This works in IE Quirks mode (which the original application was written against), as well as Chrome and Safari. I haven't checked other browsers.

However it doesn't seem to work in any version of IE in standards mode. It seems that the child element does not implicitly inherit the height of its parent table cell.

Is this an IE bug, and what is the best way to work around it?

Additional Information:

This scenario is widespread throughout an enormous legacy enterprise application that we are trying to make standards compliant. Therefore I'm looking for a solution that involves the least amount of changes possible to the markup.

4

3 回答 3

0

请定位... 即父子位置 et 分别为 :relative 和 absolute

于 2013-10-10T06:16:47.707 回答
0

这种行为在 IE 和 Firefox 中都很明显。

后者自 1999 年以来被报告为错误。

于 2015-08-26T15:16:36.957 回答
-2

将表格单元格的高度设置为 100%。

td{height:100%;}

请参阅 IE http://jsfiddle.net/gqLUw/11/中的更新小提琴

于 2013-09-26T08:28:23.197 回答