# Want to jump/scroll to a certain row in a table

**URL:** <https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542>\
**Category:** Rails\
**Created:** [October 1, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542 "2009-10-01T20:56:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [October 1, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542/1 "2009-10-01T20:56:57Z")

</div>

Hi

This might be more of an HTML question but it could be because of an  
interaction with Rails that the solution I use right now is not  
working.

I have tried several ways to jump/scroll to a certain row in a large  
table, I tried an event like

 and use  
[http://website#section#666](http://website#section#666)  
I inserted the div with the even before the and after it, both  
did not work

I have also tried to use (found this also on the  
web somewhere) but it also did not work.

 

Is there another solution that is more rails friendly? What am I  
messing up?

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [October 1, 2009, 9:34pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542/2 "2009-10-01T21:34:26Z")

</div>

You’re just using the wrong syntax. Use id=“event666” and link to it  
like [http://some/url#event666](http://some/url#event666)

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [October 1, 2009, 10:10pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542/3 "2009-10-01T22:10:09Z")

</div>

> 2009/10/1 Matt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):  
> I have tried several ways to jump/scroll to a certain row in a large  
> table, I tried an event like
> 
> and use [http://website#section#666](http://website#section#666)  
> I inserted the div with the even before the and after it, both  
> did not work

I’ve started using this recently:

> **[jQuery.scrollTo](http://demos.flesler.com/jquery/scrollTo/)**
>
> Demo of jQuery.scrollTo. Small and customizable jQuery plugin for animated scrolling, made by Ariel Flesler.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [October 1, 2009, 10:42pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542/4 "2009-10-01T22:42:20Z")

</div>

Matt wrote:

> Hi
> 
> This might be more of an HTML question but it could be because of an  
> interaction with Rails that the solution I use right now is not  
> working.
> 
> I have tried several ways to jump/scroll to a certain row in a large  
> table, I tried an event like
> 
> and use  
> [http://website#section#666](http://website#section#666)  
> I inserted the div with the even before the and after it, both  
> did not work

Right. This won’t work, both because jumping to an ID doesn’t work and  
because a div can’t surround a TR.

> I have also tried to use (found this also on the  
> web somewhere) but it also did not work.

 

This is the correct tag – but you can’t put a # into the name. What  
you want is . Then to refer to it, use the  
[http://url/of/the/page#some\_name](http://url/of/the/page#some_name) .

> Is there another solution that is more rails friendly? What am I  
> messing up?

You’re messing up basic HTML syntax, nothing to do with Rails directly.  
🙂

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [October 1, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542/5 "2009-10-01T23:29:10Z")

</div>

Thank you! That with:  
\<% if @section\>0 %\>

\<% end %\>

at the _start_ of the file was all that was needed!

On Oct 1, 1:42 pm, Marnen Laibow-Koser \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [October 1, 2009, 10:00pm UTC](https://www.ruby-forum.com/t/want-to-jump-scroll-to-a-certain-row-in-a-table/176542/6 "2009-10-01T22:00:47Z")

</div>

2009/10/1 Matt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> did not work  
> I believe div is not valid round a row (or cell for that matter), it  
> can only encompass the whole table or be within a cell. Paste your  
> html into the w3c htlm validator to check. Different browsers behave  
> inconsistently with this sort of html error, it may appear to work  
> with some.

Colin
