Question : how can i determine window size using javascript and then use it as table width and height  ?

i am creating one website and in the master page file i have created one javascript named
window size.jsp now in aspx page i take one table and use window height and width as table height and width , but how it possible ? here i can upload javascript file and aspx page so please help me ...  
 
WIndow size javascript file
 
 
 
 
aspx.cs page
 

Answer : how can i determine window size using javascript and then use it as table width and height  ?

Here's a working sample with a table. The javascript in this sample works better cross-browser than what I posted earlier. I subtracted 20 pixels for default margins.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Variable width table</title>
</head>
<body>
<table id="myTable" cellpadding="0" cellspacing="0" style="border:1px solid black;">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<script language="javascript" type="text/javascript">
var x = 0;
if (self.innerHeight){
    x = self.innerWidth;
}else if (document.documentElement && document.documentElement.clientHeight){
    x = document.documentElement.clientWidth;
}else if (document.body){
    x = document.body.clientWidth;
}
var y = 0;
if (self.innerHeight){
    y = self.innerHeight;
}else if (document.documentElement && document.documentElement.clientHeight){
    y = document.documentElement.clientHeight;
}else if (document.body){
    y = document.body.clientHeight;
}
document.getElementById("myTable").style.width = x - 20 + "px";
document.getElementById("myTable").style.height = y - 20 + "px";
</script>
</body>
</html>
Random Solutions  
 
programming4us programming4us