如何根据BG图像拉伸表格单元格?

问题描述 投票:0回答:1

我想拉伸我的表格单元格,以显示整个背景图像。现在它只根据细胞的内容延伸。

如何从一开始就让桌子与背景图像大小相同?

html image tablecell
1个回答
0
投票

使用css设置单元格的宽度和高度,例如我们有以下单元格

<td class="plus"  id="slideinit" title="more options">
  &nbsp;
  </td>

它有css

<style type="text/css">
.plus
{    
background:url(images/plus.png);
height:32px;
width:32px;
cursor: pointer;
margin-left:2px;
background-repeat:no-repeat; 
}
</style>

我使用上面的代码来拟合空单元格的宽度和高度,以将PLUS图标显示为背景图像。虽然我没有上传本例中使用的图像,但您可以从这个CSS中获得一个想法。如果上述代码不起作用,您可以共享您的代码。

© www.soinside.com 2019 - 2024. All rights reserved.