制作滚动表格,表格头不动,内容滚动
2017-08-25 09:10
323 查看
有这个需求,其实也不难,就是弄两个表格组合,结合marquue标签就行了,代码如下:
效果如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> <!-- th, td { width: 12.5%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; height: 40px; vertical-align: middle; text-align: center; } --> </style> </head> <body> <div style="padding: 20px;"> <h1 class="page-header">实时最新10条数据列表</h1> <table class="table table-bordered table-striped table-condensed " style="margin-bottom: 0px; width: 100%"> <thead> <th>用户名</th> <th>点击按钮</th> <th>所属页面</th> <th>点击类型</th> <th>点击X坐标</th> <th>点击Y坐标</th> <th>请求地址</th> <th>点击时间</th> </thead> </table> <div id="flushDIV"> <marquee direction="up" scrollamount="4" bgcolor="#fcf8e3" onmouseout="this.start()" onmouseover="this.stop()" width="100%"> <table style="table-layout: fixed" class="table table-hover table-bordered table-striped table-condensed " style="width: 100%"> <c:forEach items="${userActions }" var="list" varStatus="statu" begin="0" end="9"> <tr> <td title="${list.userid }"><c:if test="${empty list.userid }">无</c:if>${list.userid }</td> <td title="${list.text }"><c:if test="${empty list.text }">无</c:if>${list.text }</td> <td title="${list.description }"><c:if test="${empty list.description }">无</c:if>${list.description }</td> <td title="${list.type }"><c:if test="${empty list.type }">无</c:if>${list.type }</td> <td title="${list.x }"><c:if test="${empty list.x }">无</c:if>${list.x }</td> <td title="${list.y }"><c:if test="${empty list.y }">无</c:if>${list.y }</td> <td title="${list.url }"><c:if test="${empty list.url }">无</c:if>${list.url }</td> <td title="${list.dateTime }"><c:if test="${empty list.dateTime }">无</c:if>${list.dateTime }</td> </tr> </c:forEach> </table> </marquee> </div> </div> </body> <script> setInterval(function() { var index=layer.msg('数据更新中...', {icon: 16,time:0}); $.ajax({ type : 'GET', url : "${ctx}/data/getData.html", dataType : "html", cache : false, success : function(data) { layer.close(index) $('#flushDIV').html(data); } }); }, 10000); </script> </html>
效果如下:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201908/14/5d094bc15ebd6653ce568afab6fd35b9.png)
相关文章推荐
- html 表格head头部不动 body部分滚动,每格宽同内容增加
- 制作一个主页背景图不动,但网页可以向下滚动浏览内容
- Qt中修改滚轮事件:表格显示内容滚动
- html 控制表格Tbody内容滚动
- CSS实现表格表头(thead)固定,内容(tbody)滚动
- 使用css实现页面头部固定,下面随着内容的增多滚动,但是头部不动的效果
- 表头固定内容可滚动表格的3种实现方法
- jQuery - 综合实例 - 固定表头,滚动表格内容
- jsp制作复合表头并循环产生表格内容,控制隔行变色、鼠标经过改变背景色等操作
- 表头不动,内容滚动的例子(纯css+html)
- 表头固定内容可滚动表格的3种实现方法
- android界面:上下固定且中间内容滚动的页面制作
- [原]长表头表格 竖直仅滚动内容区 水平滚动表头和内容区
- 表格表头固定,内容多时滚动内容
- 制作一个简易的网页,用不同的颜色区分头部、内容以及底部,在滚动页面的过程中,底部保持不变。
- excel表中怎么让隐藏的表格中不粘贴内容-制作autohotkey快捷键
- div+css实现表头固定内容滚动表格
- ASP.NET中GridView 表头不动内容滚动解决法
- 实现这样一个表格,有横竖滚动条,竖滚动条不包括头部,横滚动条包括头部,竖滚动条滚动时头部不动,横滚动条滚动时头部动,表格单元格宽度不固定。
- 使用EXCEL 2007制作表格时,在下拉过程中使表头固定不动 冻结窗格(转载)