By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Automatic Pop-up Window Sizer

P: n/a
I have a JavaScript which opens a document in a pop-up window. The complete
document content is contained within a table of fixed width. Currently, I
pass with window height & width as parms. What I would really like is a way
to have the JavaScript automatically resize the window to fit the table!
With some digging I suspect I can get the table width but how do I get the
table length which is dependant on the amount of content?

Any help or suggestions would be appreciated....thanks....brian

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Can't you use <IFRAME> ?

in that case you put the table in te iframe, and instead of showing the
popup as e new window, load it into the IFRAME.

If you still want to use the popup try to search for offsetheight:

I used once:
hgt =
(document.all)?document.getElementById("datatd").c lientHeight:document.getEl
ementById("datatd").offsetHeight;
to get the height of a TD.. guess you can make it work for a table as well

good luck.

Marco
"Brian" <no*****@rogers.com> schreef in bericht
news:x4******************@news04.bloor.is.net.cabl e.rogers.com...
I have a JavaScript which opens a document in a pop-up window. The complete document content is contained within a table of fixed width. Currently, I
pass with window height & width as parms. What I would really like is a way to have the JavaScript automatically resize the window to fit the table!
With some digging I suspect I can get the table width but how do I get the
table length which is dependant on the amount of content?

Any help or suggestions would be appreciated....thanks....brian

Jul 20 '05 #2

P: n/a
Ivo
"Brian" <no*****@rogers.com> wrote in message
news:x4******************@news04.bloor.is.net.cabl e.rogers.com...
I have a JavaScript which opens a document in a pop-up window. The complete document content is contained within a table of fixed width. Currently, I
pass with window height & width as parms. What I would really like is a way to have the JavaScript automatically resize the window to fit the table!
With some digging I suspect I can get the table width but how do I get the
table length which is dependant on the amount of content?


Not sure about the rest, but in my IE I get good values for a table with id
TableID using
document.all.TableID.clientWidth and document.all.leden.clientHeight
and document.all.TableID.scrollWidth and document.all.leden.scrollHeight
HTH
Ivo
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.