...

View Full Version : Overflow-y: scroll position



cmc
05-20-2005, 12:15 AM
I have the following tag inside an html table:

<td><div style='height:300px; overflow-x:hidden; overflow-y:scroll'><table><tr>

<td>Row-1</td>
<tr></tr>
<td>Row-2</td>
<tr></tr>
<td>Row-3</td>
<tr></tr>
<td>Row-4</td>

etc...

This gives me a scrollable table with the scroll position set to the first row. Is the a way to make the scroll position be set to have the second, third, etc. row at the top instead of the first row.

tia,
cmc

MattyUK
05-20-2005, 12:24 AM
I am not sure that is clear enough for me to understand. At a rough glance it looks incomplete or invalid code. Can we see a link to the page please where we can look at the entire code.

Ta.

_Aerospace_Eng_
05-20-2005, 12:41 AM
This should get you off in the right start.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function scroller(){
var elem = document.getElementById('main');
howhigh= (elem.scrollHeight)/4;
elem.scrollTop = howhigh;
}
//-->
</script>
</head>

<body onload="scroller()">
<div id="main" style="height:300px;overflow:auto;">
<table style="height:600px;width:98%;margin:auto;">
<tr>
<td>Row-1</td>
<tr>
<td>Row-2</td>
</tr>
<tr>
<td>Row-3</td>
</tr>
<tr>
<td>Row-4</td>
</tr>
</table>
</div>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum