2015-11-25 109 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 */ 
} 

祝你好運,玩得開心!