IE中的双手宽度和高度

时间:2015-11-25 04:14:34

标签: javascript html css handsontable

我正在尝试以相同的宽度和宽度渲染我的Handsontable显示屏。每个浏览器的高度(IE,FF,Chrome) - 我目前将容器的高度和宽度设置为其父容器的95%。这在Chrome和FF中渲染得很好,但是在IE中,记录被截断,水平滚动会扭曲标题 - 单元格对齐。

#hot-container {
    height: 95%;
    width: 95%;
    overflow: auto; //adds scrolling to the table
}

如果我定义我的身高&设置px值的宽度,它显示正常,但我需要我的表来扩展。那有什么解决方案吗?

我的最终解决方案是当用户使用仅使用IE的CSS填充程序使用IE时使用set px h / w。我想过使用条件IF语句,但这些在我们的标准浏览器IE 11中不起作用(不支持条件)

<!--[if IE]>
<style>
    #hot-container {
         width: 800px;
         height: 500px;
    }
</style>
<![endif]-->

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

如果#hot-container是屏幕上唯一可见的项目,那么您显然可以使用position: absolute技巧!

html, body {
    width: 100%;
    height: 100%;
}

body {
    position: relative;
}

#hot-container {
    position: absolute;
    left: 0;
    right: 0;
    top: 5% /* since (100 - 95)%; 0 if you want it to fill full screen */
    bottom: 5% /* since (100 - 95)%; 0 if you want it to fill full screen */
}
祝你好运,玩得开心!

相关问题