桌子违反了W3C盒子模型

桌子违反了W3C盒子模型

The second problem is, when you look the page I gave with IE8, the first cell in the second row has 150px fixed width, but ie shows it about 50% of the total table width regardless of what i say.推荐答案您正在使用默认的 auto表布局模式.这样一来,浏览器就可以相当随意地决定为每个列分配多少空间,通常取决于单元格中实际内容的数量.在这种模式下,width仅仅是建议性的.You're using the default auto table-layout mode. That lets the browser decide fairly arbitrarily how much space to assign to each column, usually depending on the amount of actual content in the cells. In this mode, width is little more than advisory.如果希望浏览器认真对待列宽,则应在<table>元素上设置table-layout: fixed,并包括具有显式宽度的<col/>元素,或者在第一行的单元格中设置宽度您要固定宽度的列. (其他列将平均分配剩余宽度.)fixed表格布局还允许浏览器更快地呈现.If you want the browser to take your column widths seriously you should set table-layout: fixed on the <table> element, and either include <col/> elements with explicit widths, or set widths on the cells in the first row, for the columns you want to be fixed-width. (The other columns will share the remain width equally.) fixed table layout also allows the browser to render faster.对于您的页面,使用CSS定位可能会更好.当然,对于似乎仅是将图像浮动到左的内部表而言.要避免嵌套表.For your page you might be better off with CSS positioning. Certainly for the internal table that seems to exist only to float-left the image. Nested tables are to be avoided. 这篇关于桌子违反了W3C盒子模型,Ie8忽略了固定的桌子宽度!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-01 09:57