由于背景是图片,溢出似乎不起作用。
你可能会想知道为什么我没有直接为整个表格设置边框,因为它有圆角和背景图片,如果设置了整个表格的边框,就会出现“魔鬼角”,因为角落是透明的。
HTML示例:
<table class="table_style orange_header" class="ajax_table" style="font-size:12px;">
<tr>
<th style="width:248px;">Name</th>
<th style="width:314px;">Email</th>
<th style="width:237px;">Last Login</th>
<th style="width:75px;">Options</th>
</tr>
<tr class="alternate">
<td><a href="#">Example name</a></td>
<td>Example Email</td>
<td>Examlpe Email</td>
<td><a href="#">Edit</a><a class="crossbtn" href="#"></a></td>
</tr>
</table>
示例 CSS
table { border-collapse:collapse; border-spacing:0; table-layout: fixed; }
.table_style {
width: 938px;
overflow:visible;
}
th {
height: 45px;
}
.alternate {
height: 50px;
background-color: #f0f0f0;
border-left: #888 1px solid;
border-right: #888 1px solid;
}
.orange_header {
background:url(http://i1135.photobucket.com/albums/m621/Iwuqisubu/orange_table_background_zps47f8dbe4.png) no-repeat;
}
如果您的显示器不够宽以查看问题,请在 jsfiddle 上展开输出
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e8a000', endColorstr='#e86200',GradientType=0 ); /* IE6-9 */
应该仍然有效。在IE8中,如果不使用类似于http://css3pie.com/这样的东西,圆角将无法工作。但是,如果用户使用的是IE8,并且他们可能拥有较慢的计算机,他们甚至不会知道他们错过了圆角效果,只会加载更多的垃圾内容。 - cjd82187