In a javascript web app I am displaying a rather long table, filled with data coming from firebase, with code like the following.
̧ const dbReference = firebase.database().ref('MyCollection').child('CHD')
dbReference.on('value', function(list) {
list.forEach(function(item) {
itemR = document.createElement('tr'),
itemD = document.createElement('td'),
.... useful code laying out the item inside the table ....
}
}
It works as expected and I end up with my list of items in a table. But I need something more.
How can I make the window scroll automatically to a given position. For instance, to have the 157th item in the list to show at the top of the window. I have already searched the net and found some scroll functions that I tried, but with no success.