• 利用jQuery创建一个表头固定的简单HTML表格。在滚动条向下滚动时,表头不变化。


    利用jQuery创建一个表头固定的简单HTML表格。在滚动条向下滚动时,表头不变化。

    <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="jquery-ui-1.7.2.custom.min.js"></script>
    <script type="text/javascript" src="jquery.chromatable.js"></script>
    <script>

        $(document).ready(function () {

            $("#yourTableID2").chromatable({

                "900px", // specify 100%, auto, or a fixed pixel amount
                height: "400px",
                scrolling: "yes" // must have the jquery-1.3.2.min.js script installed to use

            });
        });
    </script>

    <table id="yourTableID2" width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
     <tr>
      <th>Check out this header</th>
      <th>Look here's another one</th>
      <th>Wow, look at me!</th>
     </tr>
    </thead>
    <tbody> 
     <tr>
      <td>Some content goes in here</td>
      <td>Praesent vitae ligula nec orci pretium vestibulum</td>
      <td>Maecenas tempus dictum libero</td>
     </tr>
     <tr>
      <td>Quisque in wisi quis orci tincidunt fermentum</td>
      <td>Mauris aliquet mattis metus</td>
      <td>Etiam eu ante non leo egestas nonummy</td>
     </tr>
     <tr>
      <td>Some content goes in here</td>
      <td>Praesent vitae ligula nec orci pretium vestibulum</td>
      <td>Maecenas tempus dictum libero</td>
     </tr>
     <tr>
      <td>Quisque in wisi quis orci tincidunt fermentum</td>
      <td>Mauris aliquet mattis metus</td>
      <td>Etiam eu ante non leo egestas nonummy</td>
     </tr>
    </tbody> 
    </table>

  • 相关阅读:
    C# 获取文件名及扩展名
    Javscript调用iframe框架页面中函数的方法
    jquery事件重复绑定的几种解决方法 (二)
    Jquery 点击事件重复获取叠加 (一)
    .NET 即时通信,WebSocket服务端实例
    .Net ASP.NET 打开指定文件夹
    动态 hover 使用变相使用
    给 layui upload 带每个文件的进度条, .net 后台代码
    layui upload 后台获取不到值
    ECharts配置项之title(标题)
  • 原文地址:https://www.cnblogs.com/TNSSTAR/p/2409223.html
Copyright © 2020-2023  润新知