Table Cells and Max-Widths in Internet Explorer 8

September 29, 2009

I recently came across a little issue with Internet Explorer 8 and max-width. I had an image inside of a table cell and, for some reason, IE8 completely neglected the corresponding CSS max-width property. The result was the image rendering at full size rather than scaled down to the assigned width, as expected.

After a little searching, I found that you can usually resolve this by assigning this to the affected table:

table-layout: fixed;

I’m not a huge fan of quick-fixes like this, but in the case of a blatent browser bug there isn’t much you can do without going too far out of your way. I’m sure it will be fixed in an IE8 update soon.

Discussion