【问题标题】:html table header locked to the top of the page even when scrolling down即使向下滚动,html表头也会锁定在页面顶部
【发布时间】:2017-02-21 21:30:59
【问题描述】:

我使用 Pandas DataFrame 的 to_html()style.render() 从 CSV 数据生成 html 页面。很酷!

但是当我向下滚动页面时,我看不到列名,这就是问题所在。

有没有办法把它挂在页面顶部?

【问题讨论】:

    标签: python html python-2.7 pandas dataframe


    【解决方案1】:

    这是你需要的吗?

    #NAME HERE{ 
    position: fixed; 
    {
    

    你也可以用这段代码做宽度等...

     #NAME HERE{ 
     position: fixed; 
     bottom:0px; 
     right: 0; 
     width: 0px; 
     height: 0px;
     }
    

    另外,如果您希望宽度跨越页面,只需将 0px 更改为 100% 也取决于您想要什么,将“固定”更改为“绝对”

    【讨论】:

    • position: fixed; 做了一些事情。但它始终位于第一条内容行的顶部。而且,当我向左/向右滚动头部时,我希望它与桌子的其余部分一起向左/向右移动。你介意提供一个完整的例子吗?
    • 能否提供项目或 JsFiddle 的链接?有一个视觉效果会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 2019-06-06
    • 1970-01-01
    • 2016-05-24
    • 2015-02-21
    • 1970-01-01
    • 1970-01-01
    • 2013-01-22
    • 1970-01-01
    相关资源
    最近更新 更多