How to fix table going outside of div tag in IE6 & 7?

蹲街弑〆低调 提交于 2019-12-12 04:15:42

问题


If a table is too big and the window is too small than the table goes outside the div.

I solved this with display:table !important; on the surrounding div but it doesn't work in IE 6&7 because they don't know it. How can I solve this in IE6 & 7?

See JSFiddle example: http://jsfiddle.net/Kevin1990/LNS26/10/


回答1:


Instead of using display: table, use float: left.

See: http://jsfiddle.net/thirtydot/LNS26/16/

This makes use of the "shrink wrap"/"shrink to fit" effect you get on a floated element if you don't specify an explicit width.



来源:https://stackoverflow.com/questions/5538705/how-to-fix-table-going-outside-of-div-tag-in-ie6-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!