Click to See Complete Forum and Search --> : Browser size


pgtek
11-13-2003, 11:12 AM
Hi
An other question
i have web page tha has a table in it
the table width is set 100%

how can a set it to ajust the the size browser the user is using
right now

if i change my setting to 1026
it fine
but when change to 800 it scrool

Can this be don in Javascript

thanks

Shampie
11-13-2003, 12:45 PM
Try to use the following:

document.body.clientHeight
document.body.clientWidth

These will detect the height and width of the browser itself.

Hope that migth help you with a start.

pgtek
11-13-2003, 12:50 PM
Hi

Tahnk you for your feeback
Can you give me example how and where this will be palce in my web page

<htm>

<head>


</head>
<body>

<table>
<table width = "100%>

</table>

</body>


thanks

pg

Shampie
11-13-2003, 01:20 PM
Try to work your way by this: (work it out)
*reminder, you have to refresh your browser for this page to resize it* (try it on different resolutions and refresh it)


<head>


</head>
<body>
<script>
document.write("<table width="+document.body.clientWidth+" height='274' border=0 align='center' bordercolor='#666666' bgcolor='#000000'>");
document.write("<tr bgcolor='#CCCCCC'>");
document.write("<td width=100% align=middle bgcolor='#000000'><div align='center'><br>");
document.write("<p align='center'><font color='#FFFFFF' face='AvantGarde Bk BT'>&copy; ");
document.write("Web Developer Forum</font></p>");
document.write("<p align='center'><font color='#000000'><strong><font color='#FFFFFF' face='Arial, Helvetica, sans-serif'>A helping hand</font></strong></font></font></p></td>");
document.write("</tr>");
document.write("</table>");
</script>



</body>