Hi,
I have a web page that is displayed in a pop up window. The content of the page is a simple table (1 row 1 column) with text in it. This is so I can create a red border around the text…i have considered using a div…maybe that will help in this instance….
anyway….the text can vary from 1 line to many lines. I would like the window to resize to fit the text. Currently the pop-up window is set as height=300, width=300. I have tried detecting the height of the table and setting the window height from that but the javascript can’t seem to accept that the table is an object. Here is the basic outline of the body of the document.
<BODY>
<Form id=”Form1″>
<TABLE id =”Table1″>
<tr><td>
Text here
</td></tr>
</TABLE>
</FORM>
</BODY>
I am able to resize the window using resizeTo(x,y) but detecting the height of the table is proving impossible (hmm..probably not impossible…difficult maybe ? ).
I have tried:
tableHeight = document.Form1.Table1.style.height
and
table1 = document.getElementById(“Table1”);
tableHeight = table1.style.height
with no luck. Am i missing something obvious?
Thanks
Guy
PS. I am using IE6