【问题标题】:table scroll is not working in IE表格滚动在 IE 中不起作用
【发布时间】:2018-02-02 00:34:10
【问题描述】:

我正在使用 C#、MVC 应用程序。

在这个应用程序中,我有一个包含多列的表格,我需要将水平滚动条添加到表格中以查看所有结果。

以下是我迄今为止尝试过的代码。

在cshtml文件中,

 <div class="table-responsive">
    <table id="totalResultList" class="table table-bordered table-hover" style="width:2000px;">
       <thead>
         <tr>
         <tr>
       </thead>
       <tbody>
         <tr>
         <tr>
       </tbody>
    </table>
</div>

在 Css 文件中,

.table-responsive 
{   
    width: 100%;
    /*width:2000px;*/
    margin-bottom: 15px;
    overflow-x: auto;   
    overflow-y: hidden;     
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    border: 1px solid #000000; 
}

这在谷歌浏览器中运行良好,如下图所示。

In chrome

但在 Internet Explorer 中什么也没有发生。

In internet explorer

【问题讨论】:

  • 我正在检查您在 chrome 和 IE 中的代码。根据您的图像显示,两者的结果都不同。当我们将鼠标悬停在桌面上时,IE 显示滚动条。
  • @SunilBoricha,感谢您的回复。当我将鼠标悬停在桌子上时,我也没有看到任何滚动条。
  • 您使用哪个IE进行测试?我正在测试 IE 9 到边缘。还要检查 IE 中的以下链接是否有效? jsfiddle.net/nt9mrfhp/1
  • 您好,感谢您的回复,是的,它以这种方式工作。也许我的表格数据有一些问题。再次感谢。
  • 欢迎您,亲爱的,可能是您动态填写表格,因此面临问题。

标签: c# css asp.net-mvc twitter-bootstrap razor


【解决方案1】:

给 table-layout:fixed 到 table 并将宽度应用到 'table td' 然后你也会在 IE 中滚动

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-24
    • 1970-01-01
    • 2018-02-04
    • 2013-06-29
    • 2015-01-21
    • 2011-11-22
    • 2021-04-10
    相关资源
    最近更新 更多