Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting window size using ASP or Javascript

Status
Not open for further replies.

MSucena

Programmer
Apr 16, 2004
8
US
Hello,

I need to get the size of the window and use it to set the width of an HTML table. I want the width of the table to be equal to the width of the window it is begin displayed in. Is there an ASP or Javascript function which will return the height and width of the current window. I am most interested in the width. Thanks in advance for everyone's help.

Mike
 
the best way to do this is to use liquid methods with percentages in the table scheme.

however ASP being on teh server is not the palce to do it. Simple use basic HTML tables and or CSS forum215

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page faq333-3811
 
In other words...

Code:
<table width=100% border=0 cellpadding=3 cellspacing=0>
</table>

Gives you 100% of the browser area.

If you need to know the width via javascript use the following:

Code:
var screenwidth = document.body.clientWidth;

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thanks for all your help guys. That's exactly what I needed. Thanks again.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top