Link to home
Start Free TrialLog in
Avatar of coreybryant
coreybryantFlag for United States of America

asked on

Updating table widths in JavaScript

I have this code:
<td colspan=3 align=center>
<script language="JavaScript">
<!--
function setJS() {
document.QuestionEntry.JavaScript.value = "true";
document.QuestionEntry.Target.value = "he/queryPost";
}
// Just in case the JS from the broker can't be loaded
function addOnlineReps() {
document.write('<option value="-1" selected>First available');
}
//-->
</script>
<script language="JavaScript" src="http://broker.gotoassist.com/servlet/com.ec.expertbroker.servlets.OnlineExpertsServlet?Portal=rockctech"></script>
<form action="http://broker.desktopstreaming.com/h/rockctech" method=get name=QuestionEntry>
<input type=hidden name=Portal value=rockctech>
<input type=hidden name=Target value=ds/queryPost>
<input type=hidden name=Template value=ds/onlineExperts.tmpl>
<input type=hidden name=JavaScript value=false>


<input type=hidden name=Form value=pbQuestionEntry>
<input type=hidden name=Question value="Start Session">
<input type=hidden name=Audience value="ie">
<table cellpadding=0 cellspacing=0 border=0 width=420 background="http://broker.desktopstreaming.com/partners/images/smartbox_bg.gif">
<tr>
<td align=center>
<table cellpadding=0 cellspacing=0 border=0 width=356 background="http://broker.desktopstreaming.com/partners/images/1x1.gif">

<tr>
<td height=30></td>
</tr>
<tr>
<td colspan=9><img src="http://broker.desktopstreaming.com/partners/images/ds_pb_a_top_shadow.gif" width=356 height=7></td>
</tr>
<tr>
<td bgcolor=#aaaaaa><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#c5c5c5><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#f3f3f3><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=114></td>
<td bgcolor=#ffffff align=center valign=top>
<table cellpadding=0 cellspacing=0 border=0 width=337>
<tr>
<td height=4></td>
</tr>
<tr>
<td height=4></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 border=0 width=337>
<script language="JavaScript">
<!--
document.write('<tr>');
document.write('<td colspan=2><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>');

document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to proceed.</i></b></font><br>');
document.write('<img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=10><br></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign=middle><font face=verdana,arial,helvetica size=1>');
document.write('<select name="ExpertKeys" style="font: normal 9 verdana,arial,helvetica;width:200;height20;">');

addOnlineReps(); // this will add some more options
document.write('</select></font></td>');
document.write('<td valign=middle><input type=image name="Click Here" value=submit onClick=setJS() src="http://broker.desktopstreaming.com/partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>');
document.write('</tr>');
//-->
</script>
<noscript>
<tr>
<td align=middle><img src="broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>
<font face=verdana,arial,helvetica size=2><b><i>Click button below to start a demo.</i></b></font><br>
<img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=10></td>
</tr>
<tr>
<td align=middle><input type=image name="Click Here" value=submit onClick=setJS() src="http://broker.desktopstreaming.com/partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>
</tr></noscript>
<tr>
<td height=8></td>
</tr>
</table>
</td>
<td bgcolor=#f3f3f3><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="http://broker.desktopstreaming.com/partners/images/g2a_pb_smartbox_tag.gif" width=180 height=29 alt="Powered by GoToAssist"></td>
</tr>
</table>
</form>

Now it needs to be about 190 pixels in width.  Somewhere..  The dropdown box might need to be above the click here button but I am not certain how to do that & I am afraid of messing up the code.  

Thanks!

-Corey
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coreybryant

ASKER

The still seems to stretch the cell out more than 190 pixels in width..  And I get a JS error as well

-Corey
The table with is controled by the the width attibute where you multiple times use 337 pixel and also by the width of the gifs.
I do not get any script errors.
Is your page visible online?

<html>
<head>
<base href="http://broker.desktopstreaming.com/">
<script language="JavaScript">
<!--
function setJS() {
document.QuestionEntry.JavaScript.value = "true";
document.QuestionEntry.Target.value = "he/queryPost";
}
// Just in case the JS from the broker can't be loaded
function addOnlineReps() {
document.write('<option value="-1" selected>First available');
}
//-->
</script>
<script language="JavaScript"

src="http://broker.gotoassist.com/servlet/com.ec.expertbroker.servlets.OnlineExpertsServlet?

Portal=rockctech"></script>
</head>
<body>
<table><tr>
<td colspan=3 align=center>
<form action="h/rockctech" method=get name=QuestionEntry>
<input type=hidden name=Portal value=rockctech>
<input type=hidden name=Target value=ds/queryPost>
<input type=hidden name=Template value=ds/onlineExperts.tmpl>
<input type=hidden name=JavaScript value=false>


<input type=hidden name=Form value=pbQuestionEntry>
<input type=hidden name=Question value="Start Session">
<input type=hidden name=Audience value="ie">
<table cellpadding=0 cellspacing=0 border=0 width=420 background="partners/images/smartbox_bg.gif">
<tr>
<td align=center>
<table cellpadding=0 cellspacing=0 border=0 width=190 background="partners/images/1x1.gif">

<tr>
<td height=30></td>
</tr>
<tr>
<td colspan=9><img src="partners/images/ds_pb_a_top_shadow.gif" width=190 height=7></td>
</tr>
<tr>
<td bgcolor=#aaaaaa><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#c5c5c5><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#f3f3f3><img src="partners/images/1x1.gif" width=1 height=114></td>
<td bgcolor=#ffffff align=center valign=top>
<table cellpadding=0 cellspacing=0 border=0 width=190>
<tr>
<td height=4></td>
</tr>
<tr>
<td height=4></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 border=0 width=90>
<script language="JavaScript">
<!--
document.write('<tr>');
document.write('<td colspan=2 ><img src="partners/images/1x1.gif" width=1 height=3><br>');

document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to

proceed.</i></b></font><br>');
document.write('<img src="partners/images/1x1.gif" width=1 height=10><br></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign=middle><center><font face=verdana,arial,helvetica size=1>');
document.write('<select name="ExpertKeys" style="font: normal 9 verdana,arial,helvetica;width:200;height20;">');

addOnlineReps(); // this will add some more options
document.write('</select></font><br>');
document.write('<input type=image name="Click Here" value=submit onClick=setJS()

src="partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></center></td>');
document.write('</tr>');
//-->
</script>
<noscript>
<tr>
<td align=middle><img src="broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>
<font face=verdana,arial,helvetica size=2><b><i>Click button below to start a demo.</i></b></font><br>
<img src="partners/images/1x1.gif" width=1 height=10></td>
</tr>
<tr>
<td align=middle><input type=image name="Click Here" value=submit onClick=setJS()

src="partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>
</tr></noscript>
<tr>
<td height=8></td>
</tr>
</table>
</td>
<td bgcolor=#f3f3f3><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="partners/images/1x1.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="partners/images/g2a_pb_smartbox_tag.gif" width=180 height=29 alt="Powered by GoToAssist"></td>

Here it is: http://www.rockctech.com/rct1/default_copy(4).asp - what confuses me more is you have some of the script in the <HEAD>, I put it in the body because that is where the gotoassist people had it

-Corey
This line has an error because the line is broken by newlines:


document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to

proceed.</i></b></font><br>');

Fixed those two problems: http://www.rockctech.com/rct1/default_copy(4).asp - it seems to be working locally - as far as the width, but not on the server

-Corey
Never mind.  one of the includes was moved

-Corey
Thanks for points.