I have a simple fixed width table. The first column has a fluid width and contains some simple text. The other columns are fixed width, and contain a padded div with some more simple text in them. All elements of the table are set to vertical-align: middle. Everything vertically aligns fine in IE7+, FF, Chrome, etc.
Then I’ve added some JS to toggle the display of the fixed width columns. Everything remains vertically aligned in FF, Chrome, even IE7, but for some reason IE8 goes screwy.
Here’s an demo: http://www.pinksy.co.uk/table.html
To demonstrate:
- Toggle column 4. Column 5 will then be vertically aligned as if it was still the old row height.
- Toggle column 3. Column 4 and 5 will then be vertically aligned as if it was still the old row height.
- Toggle column 2. Column 3, 4, and 5 will then be vertically aligned as if it was still the old row height.
So, it’s something to do with IE8 not being able to recalculate the vertical alignment of the remaining right-most columns with respect to the new row height.
The crazy thing is, it’s fine in IE7! Any ideas greatly appreciated!
My IE8 was running on Compatibility View mode. I could replicate your issue when I switched to normal mode. I added a nested table for the numbers and that fixed it…