Thread: sizeable <div>
View Single Post
  #2 (permalink)  
Old December 8th, 2004, 08:28 PM
vinod_yadav1919 vinod_yadav1919 is offline
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hiii johnjohn,
yes you can get the window size
*** for IE*****
//document.body.clientWidth;
//document.body.clientHeight;
*** for NS*****

//innerWidth;
//innerHeight;


<script>
function AdjustScreen()
{
obj=document.getElementById("divid")
obj.style.width=document.body.clientWidth-100
//alert(document.body.clientWidth);
//if you want you can also manipulate obj.style.height
}
window.onresize = AdjustScreen
</script>
<div id="divid" style="overflow: auto; width: 168px; height: 420px;">
<table border=1 width=100%>
<tr><td>Name</td><td>Name1</td><td>Name2</td><td>Name3</td><td>Name4</td></tr>
<tr><td>Name1</td><td>Name11</td><td>Name21</td><td>Name13</td><td>Name14</td></tr>
</table></div>

Well i haven't tested for NS
Hope this will help you

Cheers :)

vinod
Reply With Quote