【问题标题】:IE8: Table Doesn't Know To ScrollIE8:表格不知道滚动
【发布时间】:2017-10-08 16:07:34
【问题描述】:

还有一个 IE8 挂断。建议表示赞赏。

所以我有下表。一个基于用户输入的 Javascript 函数用几十个值填充 tbody。发生这种情况时,Firefox 和 Chrome 都会添加滚动条;然而,IE 却没有,并且 table simple 永远存在,甚至打破了它的 div。

如何让 IE8 识别出发生了溢出?

<div>
        <form>
        <table id="myTable" style="display: block; max-height: 300px;">
            <thead style="display: block; color: white; font-family: arial, helvetica, sans-serif; width: 796px; " > 
            <tr id=head> <B>
                <th style="width: 170px; text-align: center" >Location</th> 
                <th style="width: 70px; text-align: center">Year</th> 
                <th style="width: 520px; text-align: center" >Title</th>
                </B>
            </tr> 
            </thead>
            <tbody style="display: block; width: 796px; height: 280px; overflow: scroll; text-align: center;" > 
            </tbody>  
        </table>
        </form>
    </div>

【问题讨论】:

    标签: javascript scroll html-table internet-explorer-8


    【解决方案1】:

    您是否尝试为包含溢出属性的表格创建 CSS 类?

    .table {溢出:滚动;}

    这在 IE8 中应该可以工作。

    【讨论】:

    • 可悲的是,什么也没做。我认为这个问题与表格最初未填充这一事实有关。
    猜你喜欢
    • 2013-06-03
    • 2020-07-13
    • 2022-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多