i need help trying to dynamically change the border of tables cells.
below is how i am finding all the table cells
below is an array that defines which vertical line need to be turned on or off.Code:var arrayTD = new Array(); arrayTD = document.getElementsByName("cell");
below is the javascript i am trying to use to change the left borders of the cells, it is currently in a function that runs at body onload, but does not workCode:var arrayVLines = new Array("1","1","0");
and below is a sample table i am working withCode:for (j = 1; j < arrayVLines.length; j++) { if (arrayVlines[j] == "1"){ arrayTD.item(j).style = "border-left: #666699 solid 2px;"; } else { arrayTD.item(j).style = "border: #DDDDEE solid 1px;"; } }
please let me know if you can help. thanks in advance.Code:<form id=frm1 name=frm1> <table cellspacing="0" class="t" name="tbl1" id="tbl1"> <tbody> <tr> <td name="cell" id="c00" class="c0"> <input id="f00" value="" maxlength="2" autocomplete="off" size="4" class="s0" disabled="disabled"/> <input name="numbr" id="n00" value="" maxlength="2" autocomplete="off" size="1" class="d0"/> </td> <td name="cell" id="c10" class="c0"> <input id="f01" value="" maxlength="2" autocomplete="off" size="4" class="s0" disabled="disabled"/> <input name="numbr" id="n01" value="" maxlength="2" autocomplete="off" size="1" class="d0"/> </td> <td name="cell" id="c20" class="c0"> <input id="f02" value="" maxlength="2" autocomplete="off" size="4" class="s0" disabled="disabled"/> <input name="numbr" id="n02" value="" maxlength="2" autocomplete="off" size="1" class="d0"/> </td> <td name="cell" id="c30" class="c0"> <input id="f03" value="" maxlength="2" autocomplete="off" size="4" class="s0" disabled="disabled"/> <input name="numbr" id="n03" value="" maxlength="2" autocomplete="off" size="1" class="d0"/> </td> </tr> </tbody> </table> </form>



Reply With Quote



Bookmarks