Hi all,

I have the following structure in my HTML file:

HTML Code:
<TABLE ALIGN="left" class="altcolor" cellpadding="4"> 
<TR><TD align="center" ><a class="extlink" href="...">Some text</a>
<BR>
<TABLE WIDTH="475" ALIGN="Center" CELLPADDING="5" CELLSPACING="0">
etc...

I need to remove the WIDTH attribute from the nested table.
I have been able to get a reference to the table with the "altcolor" class (the first one).
I named the reference "alttable". So I tried this:

Code:
var table2 = alttable.getElementsByTagName("TABLE")[0];
table2.removeAttribute("WIDTH");
This code is located at the end of the HTML (in script tags)
This works in Firefox, but no luck in IE6 or IE7.
I am a noob when it comes to JS, so I was hoping someone could point out my mistake.

Thanks,
Adam