The following code might help for what you are looking for. I took the width and height in the table from the screen resolution (taken from the cookie and split) and reduced them by 300 (so that it would fit inside a browser without scrolling - set this to whatever you feel comfortable with):
<?
$url = $_SERVER['PHP_SELF'];
if(isset($HTTP_COOKIE_VARS["res"]))
$res = $HTTP_COOKIE_VARS["res"];
else{
?>
<script language="javascript">
<!--
go();
function go()
{
var today = new Date();
var the_date = new Date("August 31, 2020");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "res="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
location = '<?echo "$url";?>';
}
//-->
</script>
<?
}
?>
<?
list($width, $height) = split('[x]', $res);
$tb_width = $width-300;
$tb_height = $height-300;
print("<table align=center border=1 width=" .$tb_width . " height=" . $tb_height . " >
<tr><td align=center>Your screen resolution is " . $width . " by " . $height . ".
The width/height of this table is " . $tb_width . " by " . $tb_height . ".</td></tr>
</table>");
?>
This might not be exactly what you are looking for, but at least it has some automation so I hope it's a good start for you.
fsn812
Junior Poster in Training
93 posts since Jan 2004
Reputation Points: 41
Solved Threads: 2