?
Solved

Ensure Visible on a scrolling html table

Posted on 2005-03-25
5
Medium Priority
?
2,491 Views
Last Modified: 2008-02-01
I have a <table> element with style

      overflow-x:hidden;overflow-y:auto

The table might contain 500 rows and perhaps 40 would show on a page.

How can I for the table to scroll down to make a given element visible, like say the 400th row ?
0
Comment
Question by:plq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 13630445
perhaps

document.getElementById('rowId').scrollIntoView()

which is IE only
0
 
LVL 8

Author Comment

by:plq
ID: 13630505
Cool. Didn't know about scrollIntoView

Working...
0
 
LVL 8

Author Comment

by:plq
ID: 13631578
Works a treat
0
 
LVL 3

Expert Comment

by:hackman_3vilGuy
ID: 13631603
You can choose a row to scroll to:

document.getElementById("thetable").rows(20).scrollIntoView();

And by changing the 20:

<SCRIPT>
function scrollToRow(tblID, rowNum){
document.getElementById(tblID).rows(rowNum).scrollIntoView();
}
scrollToRow("thetableid",20);
</SCRIPT>
0
 
LVL 3

Expert Comment

by:hackman_3vilGuy
ID: 13631609
Ahh - missed it
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question