简体   繁体   English

在IE 7中替代display ='table-cell'

[英]Substitution for display='table-cell' in IE 7

document.getElementById(id).style.display ='table-cell' . document.getElementById(id).style.display ='table-cell' This gives error message in IE, this is IE bug or any other solutions please give any other solutions. 这会在IE中给出错误消息,这是IE错误或任何其他解决方案,请提供任何其他解决方案。

IE7 doesn't support this property. IE7不支持此属性。

this is my coding. 这是我的编码。 Even Firefox and Chrome are accepted. 甚至Firefox和Chrome也被接受。 My problem is IE. 我的问题是IE。 Please friends give solution... 请朋友给解决方案...

var cont2 = document.createElement('div');
cont2.style.display = "table-cell";
cont2.style.verticalAlign = "middle";
cont2.style.lineHeight = 100+"%";
cont2.style.padding = 10+"px";
cont2.appendChild(body);

In short IE7 doesn't support these display values , they post-date IE7. 简而言之,IE7不支持这些显示值 ,它们是在IE7之后发布的。

Without knowing your layout, I don't know exactly the solution you're after, but if you want to support IE7, you can't use display: table-cell; 不知道您的布局,我不确定您要使用的解决方案,但是如果您要支持IE7,则不能使用display: table-cell; , they are mutually exclusive. ,它们是互斥的。 Is it possible to change your layout to use another format, or a conditional stylesheet for IE perhaps ? 是否可以将布局更改为使用其他格式,或者使用IE的条件样式表

If the only browser it's not working in is IE, then yes, it's likely a bug in IE. 如果唯一不能使用的浏览器是IE,则可以,这可能是IE中的错误。 (At least old versions of) IE have never supported the table display properties properly. IE(至少是旧版本)从未正确支持表显示属性。

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

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