Scroll to location of a table row

I have a function which finds occurrences of a given string within an html table and highlights the row(s) in which that string are found (using an id which is attached to each row when the table is built by an agent call). My client would like to scroll the container div to the first instance of a highlighted tr tag. I can obtain the id, of course, but is there a way to cause the parent to scroll so that the table row in question will be visible in the scrollable area?

My html fragment looks like this:

The spreadcontainer div contains general data based on the output of the agent. The general output from the agent (the table) is written to the div tableoutput.


StatusDefinitionAction to be takenMerchandise Disposition

Subject: Scroll to location of a table row

There may be a better way (I am a bit out of my depth when it comes to JavaScript and such), but couldn’t your agent also create an anchor tag at the beginning of the first cell of the table row with the same id, then you could jump to that. Something like which could then be reached by setting the location.href to “#id33”.

Subject: RE: Scroll to location of a table row

We think alike. I was just having the same conversation with a colleague. Bad day, brain hasn’t yet recovered from the 4 day weekend. Gracias.