如何获得显示:IE中的表格单元支持? 任何纯javascript或jQuery解决方法?

如何获得display:table-cell IE中的display:table-cell支持? 我需要最轻的解决方案。

最快(但不干净)的解决方案是用条形注释中的表来包装容器,就像这样

  

可以接受单个页面,但绝对要大规模避免

否则你可以详细说明为什么要尝试定义一个显示:table-cell。 如果这与获得文本的垂直对齐有些相关,您可以查看这段代码

http://jsfiddle.net/fcalderan/985e4/

– 编辑(评论后)

如果你想获得一个底部对齐,你也可以设置position : relative对于图像容器,然后position: absolute; bottom: 0; position: absolute; bottom: 0; 到图像

– 编辑2(评论后)

我们还在等你的代码。 无论如何,产生的CSS将是

 #imagecontainer { /* or whatever image container you have */ position: relative; } #imagecontainer img { position: absolute; bottom : 0; left: 50%; margin-left:-n/2px; /* where 'n' is width of your image */ } 

可能如果你看一下测试网站 ,它使用display: table-cell的不同组合,你可以更轻松地选择你需要的CSS设置吗?

没有版本的Internet Explorer(包括IE8)支持属性值“inline-table”,“run-in”,“table”,“table-caption”,“table-cell”,“table-column”,“table- column-group“,”table-row“或”table-row-group“。

这是w3schools的笔记

我想你应该尝试另一种方式。