如何在表格的单元格中填充(背景)图像? [英] how to fill (background) image in a cell of a table ?

查看:102
本文介绍了如何在表格的单元格中填充(背景)图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图像应填充单元格的100%.
我将表格添加到了Web表单中,以使网页更清晰.
因为单元格应该包含图像.我从工具箱中添加了图像.但它只能部分填充,即仅填充单元格的一部分.

您能帮我摆脱这些苦难吗?谢谢你..

解决方案

对每个td标签都使用css类,而不要对td上的css使用css类.具有className属性,如下所示

< table>
< tr>
< td class="img1">Text< /td>
< td class="img2">Text 2< /td>
< /tr>
< /table>



然后像下面这样写Css:

.img1
{
background-image:url(''images/back.jpg'');
background-repeat:norepeat:
}
.img2
{
background-image:url(''images/back2.jpg'');
background-repeat:norepeat:
}


The image should fill the cell 100%.
i added table to the web form for clear layout of my web page.
in that a cell should contain the image. i added image from tool box. but it is filling partially, i.e., only a part of the cell.

Can u pls help me out from these? Thank u..

解决方案

use css class for every td tag not the css on td


Lets Consider this is your table with className attribute as shown below

< table>
< tr>
< td class="img1">Text< /td>
< td class="img2">Text 2< /td>
< /tr>
< /table>



Then write Css like below:

.img1
{
background-image:url(''images/back.jpg'');
background-repeat:norepeat:
}
.img2
{
background-image:url(''images/back2.jpg'');
background-repeat:norepeat:
}


这篇关于如何在表格的单元格中填充(背景)图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆