1
<table class="schedule">
<thead>
<tr>
<th id="first-column">#</th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
</tr>
</thead>
</table>
table.schedule {
table-layout: fixed;
width: 900;
}
#first-column {
width: 200px;
padding: 0 10px;
}
原因的第一列具有在Firefox 200 + 10 + 10 = 220px宽度,但180 + 10 + 10 =在Chrome和Safari 200像素。我认为width
不应该包括padding
,所以Firefox是正确的?但无论如何,我如何在浏览器上设置相同的列宽?
编辑:的Chrome开发者工具的样子:
即使在Chrome中,我也会将其视为200px!你使用的是什么版本的浏览器?我知道,在“美化”的Chrome中,默认情况下,它倾向于为textarea等某些组件添加额外的填充。你已经明确地覆盖了它们。 – PhD