is it a bug or a feature?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • duye
    New Member
    • Jan 2007
    • 10

    is it a bug or a feature?

    Below is a testing code:
    1. click the "change COL color", you will see the 2nd COL is red.
    2. click the "change Row color", you will see the 2nd Row is blue, the lower right cell which was the red now changed to blue.
    3. click the "change COL color" again, expecting to see the lower right cell changed back to red, but it keeps the blue color, can not be changed.
    4. click the "change Row color back" , the 2nd row is changed to white color, click again "change COL color" , expecting to see the lower right cell changed to red, but again, nothing happens.

    So the conclusion here is:
    as soon as a row color change happens, col color change is not available, WHY? a bug ? or a feature?

    This happens on both IE6 and Mozila2.

    <html>
    <head>
    <title></title>
    <script type="text/javascript">
    function changeRow(){
    document.getEle mentById("r2"). style.backgroun dColor="blue";
    }
    function changeRowBack() {
    document.getEle mentById("r2"). style.backgroun dColor="white";
    }
    function changeCol(){
    document.getEle mentById("c2"). style.backgroun dColor="red";
    }
    </script>
    <style type="text/css">

    </style>
    </head>
    <body>

    <table border=1 width=200>
    <col id="c1"></col><col id="c2"></col>
    <tr id="r1"><td>1</td><td>2</td></tr>
    <tr id="r2"><td>3</td><td>4</td></tr>
    </table>
    <p> <a href="" onclick="change Row(); return false;" >Change Row Color</a>
    <p> <a href="" onclick="change RowBack(); return false;" >Change Row Color Back</a>
    <p> <a href="" onclick="change Col(); return false;">Change Col Color</a>

    </body>
    </html>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    I can't say I know but I'm not sure you are using the <col> element properly. Isn't that supposed to be used with <colgroup> or whatever?

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      I dont know if this is right but I would assume, that because you create the row after you create the col, the row would be rendered on top of the col.

      That is.. both the col are rendered red, but then the row is rendered and the bottom left cell who was red cuz is belongs to the col, is repainted white / blue.

      Comment

      Working...