esempio base
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>scroll livello in td</title>
<style type="text/css">
table {
border-collapse:collapse;
width:500px;
height:1500px;
}
td {
border:1px solid #660;
margin:0px;
padding:5px;
vertical-align:top;
}
</style>
<script type="text/javascript" language="JavaScript">
<!--
function scrollAmount(){
return (window.pageYOffset) ? window.pageYOffset :
((document.documentElement && document.documentElement.scrollTop) ?
document.documentElement.scrollTop : document.body.scrollTop)
}
function doScroll(){
document.getElementById('box').style.top=scrollAmount()+'px';
}
window.onscroll=doScroll
//-->
</script>
</head>
<body>
<table>
<tbody>
<tr>
<td><div id="box" style="position:relative;top:0px">livello</div></td>
<td>contenuto</td>
</tr>
</tbody>
</table>
</body>
</html>
ciao