Ok I'll try to be as clear as possible with what I want, but for all I know the solution might be so damn simple... anw...

I have a picture, alright.. usual way of putting it:

<table><tr><td>
<img src='bla bla' height='100%' width='100%'>
</td></tr></table>

And I actually wanted it to be something like a background coz I wanted to have some textbox on in!

But if I do:

<table background='bla bla'>
....</table>

the problem with this is that the image is treated like... well, a background and not an image... If I were to open the web with a higher resolution comp, the picture will just duplicate itself and it suck. Whereas when I left it as an <img> with 100% width and height the picture will auto resize itself, which is what I want.

Ok so one "solution" I got was to dissect my pics into multiple pics and arrange it in a way that it'll look as if my textboxes are on top of my picture... but it's so tedious! Is there no other way?

Is there a way to "lock" the table's background image to the size of the table itself?

Recommended Answers

All 5 Replies

Member Avatar for diafol

Can't you do a z-index in css?

table tr td img{
  z-index: -1;
}

If not using css, place in style tags in head area of page:

<style>
table tr td img{
  z-index: -1;
}
</style>

what about background-image:no repeat:x or y whatever

Thanks Ardav! I managed to do it... =)
For reference's sake:

<style type="text/css">
div.main
{
position:absolute;
left:7px;
right:7px;
top:75px;
z-index:-1;
}
</style>
<div class="main">
<img name="out" src="whatever.jpg"  width="100%" height="100%">
</div>

what does it mean its not treated like an image

Member Avatar for diafol

what does it mean its not treated like an image

I think he was referring to the bg img not resizing when treated as a 'background-image' attribute in css. If it's tagged (<img>) you can set auto-resize on window resize (100%).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.