Thread: fitting window to table
Results 1 to 3 of 3
Related
-
Passing value from parent window to child window Forum: Javascript Forum
Replies: 0 -
Accessing a element of parent window in child window Forum: Javascript Forum
Replies: 1 -
Web page fitting all screen sizes. Forum: HTML Forum
Replies: 3 -
How can you make a table border on only one side of the table? Forum: HTML Forum
Replies: 5
-
02-21-2001, 11:01 AM #1
fitting window to table
Hi there,
I want to resize a window to fit an image... unless this image's width is smaller than a table (where i put my buttons in), then the window has to resize to the table's width.
I already found a way to do this but have to give the table a name ... how can i do this ? ( I already tried the tag <table width="280" border="0" cellspacing="0" cellpadding="0" NAME="table1">, this didn't work)
Here's the piece of JS-code where it should happen :
if (document.images['Image1'].width < document.all.Table1.width)
{x = document.all.Table1.width} else {x = document.images['Image1'].width};
y = document.images['Image1'].height + 150;
window.resizeTo(x,y);
does this work...document.all.Table1.width ?
Thanks.
------------------
-=ACiD=-
-
02-22-2001, 02:25 AM #2Originally posted by ACiD:
( I already tried the tag <table width="280" border="0" cellspacing="0" cellpadding="0" NAME="table1">, this didn't work)
Last edited by HTML; 09-10-2003 at 06:14 PM.
-
02-25-2001, 07:49 PM #3
The reference document.all ... is to the element's ID, not its name. The table should be
<table width="280" border="0" cellspacing="0" cellpadding="0" id="Table1">
However I warn against doing this - it is not polite to force-resize a user's browser window; I would not visit a site that did that to me.
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum