爱意满满的作品展示区。
maomaomao001

分享 html 表格 可固定标题和列 (也适用于 移动客户端 )

  •  
  •   maomaomao001 · May 9, 2016 · 3424 views
    This topic created in 3835 days ago, the information mentioned may be changed or developed.
    顺带求个 在安卓上性能更好的这种表格.

    在谷歌 ,android 4.1 ,微信 x5 , iphone 上效果很好,完全没有延迟,

    Demo 地址:
    http://maomaomao.coding.me/games/table2/example1.html

    使用 jq:
    http://maomaomao.coding.me/games/table2/example2.html

    ps:导入怎么把 jquery 中的 windth 方法分类出来....


    谷歌浏览器上的效果:
    1.


    2.




    UC 9.0 上 标题行总是慢一点.
    桌面版 firefox 上无法对齐.求大神找找为什么 在火狐上不正常吧,谢谢!

    3.火狐上的效果




    完全一样的代码.前端好难做到兼容很多浏览器啊.求 v 站大神们帮帮....
    5 replies  •  2019-12-31 14:43:46 +08:00
    qhxin
    qhxin
    May 9, 2016
    1
    依赖 scroll 事件回调啊,有延迟的话,试试用定时器去刷新呢。
    qhxin
    qhxin
    May 9, 2016
    2
    至于对不齐,应该是盒模型没一致吧。边框宽度导致的。
    maomaomao001
    maomaomao001
    OP
    May 9, 2016 via Android
    3
    @qhxin 定时器刷新? 段时间没不停的刷新?
    sinosure
    sinosure
    May 14, 2016
    4
    很好,挺有用的
    maomaomao001
    maomaomao001
    OP
    Dec 31, 2019
    5
    居然 css 已经有最好的方案了,sticky 定位

    https://codesandbox.io/s/epic-tu-12rmy?fontsize=14&hidenavigation=1&theme=dark


    <iframe
    src="https://codesandbox.io/embed/epic-tu-12rmy?fontsize=14&hidenavigation=1&theme=dark"
    style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
    title="epic-tu-12rmy"
    allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
    sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
    ></iframe>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1545 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:00 · PVG 16:00 · LAX 00:00 · JFK 03:00
    ♥ Do have faith in what you're doing.