Solved

Updating table widths in JavaScript

Posted on 2004-10-25
461 Views
Last Modified: 2012-06-27
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
0
Question by:coreybryant
    8 Comments
     
    LVL 63

    Accepted Solution

    by:
    How about this:

    <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=356 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=356 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=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="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>
    </tr>
    </table>
    </form>


    0
     
    LVL 29

    Author Comment

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

    -Corey
    0
     
    LVL 63

    Expert Comment

    by:Zvonko
    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>

    0
     
    LVL 29

    Author Comment

    by:coreybryant
    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
    0
     
    LVL 63

    Expert Comment

    by:Zvonko
    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>');

    0
     
    LVL 29

    Author Comment

    by:coreybryant
    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
    0
     
    LVL 29

    Author Comment

    by:coreybryant
    Never mind.  one of the includes was moved

    -Corey
    0
     
    LVL 63

    Expert Comment

    by:Zvonko
    Thanks for points.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: From Zero to Hero with Nodejs & MongoDB

    Interested in Node.js, but don't know where to start or how to learn it properly? Confused about how the MEAN stack pieces of MongoDB, Expressjs, Angularjs, and Nodejs fit together? Or how it's even possible to run JavaScript outside of the browser?

    Suggested Solutions

    In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
    I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now