如何使用HTML和CSS将表格与滚动条一起拖动? [英] How to drag table along with scroll bar using HTML and CSS ?

查看:263
本文介绍了如何使用HTML和CSS将表格与滚动条一起拖动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





有人建议我的任务解决方案...



我创建了一个带有垂直滚动条的HTML页面中的表格(页面滚动条,不适用于表格)。



任务是如果我向下拖动滚动条,表格也应该拖动滚动条。



我到目前为止尝试的是...

在css文件中我将表格位置标记为固定,它是工作正常,但在使用很多行时,底部行隐藏在表格中,我也不能最小化表格大小。

Hi,

Someone suggest a solution for my task...

I created a table in a HTML page with vertical scrollbar(scroll bar for page, not for table).

Task is if I drag scroll bar down, table should also drag along with a scroll bar.

What i tried so far is...
In css file i marked the table position as fixed, It is working fine but while using many rows, bottom rows are hidden in the table, I can't minimize the table size also.

#Table
{
  position:fixed;
}











在此先感谢.....

R.Karthik






Thanks in Advance.....
R.Karthik

推荐答案

通过设置
position:fixed;

不足以满足您的需求。它会将位置固定到固定点。您需要编写一些脚本以使其在滚动时粘滞,或者您可以使用任何第三方插件来实现相同的目标。



有很多插件可用于粘贴元素。

例如你可以参考下面的插件:



StickyJS

StickyMojo /

使用CSS和jQuery

Sticky Scroll插件列表



有很多插件可供您用来满足您的需求。



希望这会有所帮助!

will not suffice your need. It will fix the position to fixed points. You need to write some scripts to make it sticky on scroll or you can use any third party plugins to achieve the same.

There are lot of plugins available to make sticky elements.
For example you can refer below plugins:

StickyJS
StickyMojo/
Using CSS and jQuery
Lists of Sticky Scroll Plugins

There are plenty of the plugins available that you can use to achieve your requirement.

Hope this helps!


这篇关于如何使用HTML和CSS将表格与滚动条一起拖动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆