【问题标题】:Handsontable Width and Height in IEIE 中的 Handsontable 宽度和高度
【发布时间】:2016-02-27 18:19:21
【问题描述】:

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

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

如果我用一组px 值定义我的高度和宽度,它显示得很好,但是我需要我的表格进行缩放。有什么解决办法吗?

我的最终解决方案是在用户使用 IE 时使用一组 px h/w 并使用仅限 IE 的 CSS shim。我想使用条件 IF 语句,但这些在我们的标准浏览器 IE 11 中不起作用(不支持条件)

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

有什么想法吗?

【问题讨论】:

    标签: javascript html css handsontable


    【解决方案1】:

    如果#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 */
    }
    

    祝你好运,玩得开心!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-07
      • 2018-06-09
      • 2014-04-15
      • 1970-01-01
      • 2018-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多