Css 镀铬的表格单元格填充问题
我有很多问题与表细胞填充铬。看起来,如果表格单元格不包含纯文本,则根本不应用填充 我的标记:Css 镀铬的表格单元格填充问题,css,google-chrome,firefox,html-table,padding,Css,Google Chrome,Firefox,Html Table,Padding,我有很多问题与表细胞填充铬。看起来,如果表格单元格不包含纯文本,则根本不应用填充 我的标记: <table> <tr> <th></th> <th class="account-picture"></th> <th class="account-name">Name</th> <th
<table>
<tr>
<th></th>
<th class="account-picture"></th>
<th class="account-name">Name</th>
<th class="account-email">Email</th>
<th class="account-last">Last Sign in</th>
</tr>
<tr>
<td>
<fieldset>
<ul>
<li><input type="checkbox" id="enabled" name="test[]" value="enabled"></li>
</ul>
</fieldset>
</td>
<td class="account-picture">
<div class="online">
<img src="http://www.genengnews.com/app_themes/genconnect/images/default_profile.jpg"> </div>
</td>
<td class="account-name">test test test test test test test test test test test test test test test test test test</td>
<td class="account-email">test test test test test test test test test test test test test test test test test test</td>
<td class="account-last">15 April 2012 10:19 AM</td>
</tr>
</table>
还有小提琴:
这就是它在firefox 11中的表现:
Chrome:18(最新版本):
IE9:
可以看出,IE和FF可以正常工作,但不能与chrome一起工作。为什么会发生这种情况,以及可能的解决方案是什么?删除了
表格布局:修复了,并且似乎有效
如果要使用table layout:fixed
,则应使用width
而不是minwidth
来定义列宽
不知道为什么只有Chrome在播放,但也许它有一个更好的标准实现。也许关闭你的输入元素会有帮助:
,尽管我觉得如果Chrome不能优雅地处理这个问题有点奇怪。。。(您的img
元素也是如此,顺便说一句)在关闭的输入元素中仍然存在相同的问题。尽管我认为如果使用HTML5 doctype,没有必要关闭输入标记。
img{
height: 42px;
width: 42px;
}
td, th{
padding: 0 12px;
vertical-align: middle;
}
.account-picture{
width: 40px;
}
.account-name{
min-width: 100px;
}
.account-email{
min-width: 120px;
}
.account-last{
min-width: 140px;
}
table{
table-layout: fixed;
float: none;
width: 100%;
margin-top: 10px;
}
td, th{
word-wrap: break-word;
padding: 0 12px;
vertical-align: middle;
}
td:first-child, th:first-child{
width: 14px;
}