简体   繁体   English

加载html页面时,如何将表格设置为已在特定列上滚动?

[英]How can I set a table to be already scrolled at a certain column when i load the html page?

I have a table that has a various number of columns depending on the number of months that are inputted from my database starting from a start_date and towards an end_date. 我有一个表,该表具有不同的列数,具体取决于从数据库中输入的从start_date到end_date的月份数。 I know as a variable the current_date and i need to make the table load with the x-scrollbar right on top of my current_date because the current date can be very far from the beginning of the table and I am supposed to scroll towards it. 我知道current_date是一个变量,我需要用x-scrollbar在我的current_date顶部使表加载,因为当前日期可能离表的开头很远,我应该向它滚动。

Click here to see my table 点击这里查看我的表格

Is there any possibility that I can set the x-scrollbar to start from a certain position? 我可以将x滚动条设置为从某个位置开始吗?

This will help you 这对你有帮助

 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>scrollTop demo</title> <style> div.demo { background: #ccc none repeat scroll 0 0; border: 3px solid #666; margin: 5px; padding: 5px; position: relative; width: 200px; height: 100px; overflow: auto; } p { margin: 10px; padding: 5px; border: 2px solid #666; width: 1000px; height: 1000px; } </style> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <div class="demo"><h1>lalala</h1><p>Hello</p></div> <script> $( "div.demo" ).scrollTop( 300 ); </script> </body> </html> 

jQuery scrollTop jQuery scrollTop

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在页面已经向左滚动的情况下加载 JinvertScroll 驱动的页面? - How can I make JinvertScroll driven page load with page already scrolled left? 当用户已经向下滚动页面时,如何导航到锚标记? - How can I navigate to an anchor tag when user has already scrolled down page? 使用 jQuery 将页面滚动到某个点时,如何更改文本? - How can I make text change when a page is scrolled to a certain point using jQuery? 滚动到页面顶部时如何隐藏按钮? - How can I hide a button when scrolled to the top of a page? 我希望我的 html 页面在我提交某个输入时重定向到另一个 html 页面我该怎么做 - I want my html page to redirect to another html page when I submit a certain input how can i do that 当页面滚动到一定数量的像素时,您可以使用jQuery / Javascript隐藏html div吗? - Can you hide an html div with jQuery/Javascript when the page is scrolled to a certain number of pixels? 我可以告诉浏览器开始显示已向下滚动的网页吗? - Can I tell a browser to start display of a web page already scrolled down? 滚动页面时如何移动 HTML 元素? - How to move HTML elements when a page is scrolled? 当HTML元素低于页面的某个部分时,如何删除它? - How can I remove a HTML element when it goes below a certain part of the page? 如何制作圆形页面? (当滚动到页面内容的末尾时,页面将内容的开头添加到底部等) - How can I make a circular page? (when scrolled to the end of page content, page adds the beginning of conten to the bottom and so forth)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM