I'm trying to switch the width of two columns in a table when a user clicks on an image. I'm using a JavaScript on click even and if I put the new column width as % it works but it doesn't seem to work using px or em which is wht I want use to have better control over the columns. This is the 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 is that makes a difference. Can anyone help me?
overflow: hiddenandwhite-space: nowrapon your cells. Note, however, that this will end up hiding content that overflows the cell.