Can't get cell to shrink to zero

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jammer

    Can't get cell to shrink to zero

    I have a simple HTML table that I want to use as a progress bar - by
    changing the width of the two TD elements with javascript, you show
    progress. The problem is that when I change the width to 100 and 0
    resp., you still see a sliver of white for the right cell... any way
    to do this, it's drivin me nuts! I tried also changing the back color
    of the right cell to blue when it hits 100, but it only works in
    Mozilla/Firefox, not IE. Plz help?? :)

    <html>
    <head></head>
    <body>

    <table width="250" cellpadding="0" cellspacing="0" hspace="0"
    vspace="0" height=20>
    <tr>
    <td width=20% bgcolor=blue id="leftCell" style="border-top: 1px
    solid;
    border-bottom: 1px solid;border-left: 1px solid;">
    &nbsp;
    </td>

    <td width=80% bgcolor=white id="rightCell" style="border-top: 1px
    solid;
    border-bottom: 1px solid;border-right: 1px solid;">
    &nbsp;
    </td>
    </tr>
    </table>

    <SCRIPT>
    document.getEle mentById("leftC ell").width="10 0%";
    document.getEle mentById("right Cell").width="0 %";
    //document.getEle mentById("right Cell").style.ba ckgroundColor =
    "green";
    </SCRIPT>

    </body>
    </html>
  • MikeB

    #2
    Re: Can't get cell to shrink to zero

    This is not how you are doing it, but it may give you an idea for a workaround (The Timer is merely to
    demo the progress):
    <html>
    <HEAD>
    <TITLE>This is the Application Caption</TITLE>
    <HTA:APPLICATIO N ID="oApp"
    APPLICATIONNAME ="Splash Screen"
    BORDER="thick"
    MAXIMIZEBUTTON= "yes"
    MINIMIZEBUTTON= "yes"
    CAPTION="YES"
    ICON="C:\Progra m Files\RBTI\RBG7 \Samples\Icons\ win1.ico"
    SHOWINTASKBAR=" yes"
    SINGLEINSTANCE= "yes"
    SYSMENU="yes"
    WINDOWSTATE="no rmal">
    <SCRIPT>
    var cntr = 0;
    var ID = 0;
    function UpdateTimer()
    {
    cntr = cntr - 5000;
    }
    function UpdateProg()
    {
    //debugger;
    //var IDtx;
    if (ID <= 9)
    {
    document.getEle mentById('C' + ID.toString()). bgColor="blue";
    }
    //IDtx.bgcolor=bl ue;
    ID++;
    cntr = cntr-5000;
    }
    function init()
    {
    cntr = 30000;
    UpdateProg();
    var UpdateTime = window.setInter val('UpdateProg ()',1000);
    return;
    }
    function Terminate()
    {
    window.clearTim eout();
    // window.close();
    }
    </SCRIPT>
    </HEAD>

    <body onload="init(); return false;" onUnload="Termi nate(); return false;">
    <table width="100%" cellpadding="0" cellspacing="0" hspace="0" vspace="0" height=20>
    <tr>
    <td width="10%" bgcolor=white id="C0"></td>
    <td width="10%" bgcolor=white id="C1"></td>
    <td width="10%" bgcolor=white id="C2"></td>
    <td width="10%" bgcolor=white id="C3"></td>
    <td width="10%" bgcolor=white id="C4"></td>
    <td width="10%" bgcolor=white id="C5"></td>
    <td width="10%" bgcolor=white id="C6"></td>
    <td width="10%" bgcolor=white id="C7"></td>
    <td width="10%" bgcolor=white id="C8"></td>
    <td width="10%" bgcolor=white id="C9"></td>
    </tr>
    </table>
    </body>
    </html>
    "Jammer" <jkerr@fundy.ne t> wrote in message news:7d0dda47.0 404240922.3c728 868@posting.goo gle.com...[color=blue]
    > I have a simple HTML table that I want to use as a progress bar - by
    > changing the width of the two TD elements with javascript, you show
    > progress. The problem is that when I change the width to 100 and 0
    > resp., you still see a sliver of white for the right cell... any way
    > to do this, it's drivin me nuts! I tried also changing the back color
    > of the right cell to blue when it hits 100, but it only works in
    > Mozilla/Firefox, not IE. Plz help?? :)
    >
    > <html>
    > <head></head>
    > <body>
    >
    > <table width="250" cellpadding="0" cellspacing="0" hspace="0"
    > vspace="0" height=20>
    > <tr>
    > <td width=20% bgcolor=blue id="leftCell" style="border-top: 1px
    > solid;
    > border-bottom: 1px solid;border-left: 1px solid;">
    > &nbsp;
    > </td>
    >
    > <td width=80% bgcolor=white id="rightCell" style="border-top: 1px
    > solid;
    > border-bottom: 1px solid;border-right: 1px solid;">
    > &nbsp;
    > </td>
    > </tr>
    > </table>
    >
    > <SCRIPT>
    > document.getEle mentById("leftC ell").width="10 0%";
    > document.getEle mentById("right Cell").width="0 %";
    > //document.getEle mentById("right Cell").style.ba ckgroundColor =
    > "green";
    > </SCRIPT>
    >
    > </body>
    > </html>[/color]


    Comment

    • Jammer

      #3
      Re: Can't get cell to shrink to zero

      Hmm... cool, thanks for the response! I was really hoping to get a
      version like mine working because I really like the smooth scrolling
      of it if I update every percentage... I suppose I could just make 100
      increments... :)

      Comment

      • MikeB

        #4
        Re: Can't get cell to shrink to zero


        "Jammer" <jkerr@fundy.ne t> wrote in message news:7d0dda47.0 404251419.7ccd4 b4e@posting.goo gle.com...[color=blue]
        > Hmm... cool, thanks for the response! I was really hoping to get a
        > version like mine working because I really like the smooth scrolling
        > of it if I update every percentage... I suppose I could just make 100[/color]

        Yes. The 10 was just to demonstrate. Further, you could create them at runtime during body onload....

        [color=blue]
        > increments... :)[/color]


        Comment

        Working...