我已经创建了我的问题的小提琴的小提琴这里: http://jsfiddle.net/tpSjf/边框扩大表,但切断的背景图像
我在桌子上添加边框,但只适用于行,现在的边界扩大表格的宽度是2px,所以我将宽度设置为938px。这纠正了宽度问题,但切断了标题中的部分图像。
溢出似乎并没有工作,因为它是一个背景。
你可能想知道为什么我不只是设置边框为整个表,以及它的圆角和它得到“魔鬼角”的角落背景图像是透明的。
例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输出,如果您的显示器不够宽,看问题
有为什么它需要有一个固定的宽度和有背景图像的原因是什么?这实际上限制了你可以对表格做什么。我将它转换为css渐变,并使用border-radius和100%宽度,使其更具多功能性。 http://jsfiddle.net/Th2Ls/ – cjd82187 2013-05-22 22:19:18
问题是它需要与IE8一起工作,而我的设计师很烦人,他希望它具有纹理 – Adam 2013-05-23 07:54:10
最后一个用于渐变的滤镜我使用了'filter:progid: DXImageTransform.Microsoft.gradient(startColorstr ='#e8a000',endColorstr ='#e86200',GradientType = 0);/* IE6-9 * /'仍然可以工作。圆角在不使用类似http://css3pie.com/的情况下不会在IE8中工作,但是,如果用户在IE8上的电脑速度较慢,并且甚至不知道他们是谁,那么您只需加载越来越多的垃圾无论如何,缺少圆角。 – cjd82187 2013-05-23 13:00:44