开发者

100% height on nested table cell in IE [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 9 years ago.

Improve this question

I want a nested table to expand to the height of the enclosing cell. This works as expected in Firefox/Chrome/Safari, but not in IE7 or IE8. Please see the example here:

http://www.bitmechanic.com/heightDemo.html

The DOCTYPE is relevant. While the demo above validates as HTML 4.01 Strict, it does not render properly in IE7. If I remove the DOCTYPE entirely, or set it to HTML 3.2, it renders properly in IE.

Any suggestions on how to get this to render in 4.01 (strict or loose)? The actual web site is a bit more complicated -- changing the DOCTYPE will cause all sorts of other problems.

We're struggling to und开发者_JS百科erstand the (presumed) IE bug here and how to work around it.


Not much you can do it's IE that is still misbehaving also in version 7 and 8. Read this answer: Table layout wrong in IE(7)

You have only two solutions:

  1. either you remove the DOCTYPE for that page with the risk to get into many other displaying issues,

  2. or you have to use Javascript to get the height of the table and you enforce the cells height in px to the same height of the table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜