How do I change the column width in a table using JavaScript? -


i'm trying switch width of 2 columns in table when user clicks on image. i'm using javascript on click , if put new column width % works doesn't seem work using px or em wht want use have better control on columns. code i'm using:

<img alt="change widths" title="switch column widths" src="/*images_path*/*image*.png" onclick="for (j=1;j<=200;j++){document.getelementbyid('cola'+j).style.width = '60%'; document.getelementbyid('colb'+j).style.width = '28%';}" onmouseover="this.style.cursor='pointer';"/> 

i'm using firefox makes difference. can me?

try using document.getelementbyid().width instead of .style.width


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -