2015-11-25 128 views
0

我试图在每个浏览器(IE,FF,Chrome)上使用相同宽度&高度呈现我的Handsontable显示 - 我当前将容器的高度和宽度设置为其父容器的95% 。这在Chrome和FF中呈现良好,但是在IE中,记录被截断并且水平滚动会扭曲标题 - 单元格对齐。在IE中Handsontable的宽度和高度

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

如果我定义我的身高&宽度与一组px值,它显示就好了,但是我需要我的表规模。有没有解决方案呢?

我的最终解决方案是使用一套px h/w当用户使用IE浏览器只使用CSS垫片。我想与条件IF语句中去,但这些并不在我们的标准浏览器中运行,IE 11(不支持条件)

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

任何想法?

回答

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 */ 
} 

祝你好运,玩得开心!