<!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> </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>
|