Could anyone please help me with a problem I am having with my table
widths???
If I have 2 images within a td tag, but using CSS relative positioning I
position one over the top of the second (I am placing a transparent gif
over the top of a normal gif) then the width of my table is large enough
to accommodate both images side by side
My browsers (both IE ad Firefox) do not appear take into account the
relative positioning of my transparent gif (i.e. it only needs enough
space for one gif as the other sits on top of it).
As an example try the following:
<html>
<body>
<table border="1">
<tr>
<td>
<img height="50" width="200" alt="real-gif" src="real.gif"/>
<img height="50" width="200" style="position :relative;
left:-100px;" alt="transparen t-gif" src="transparen t.gif"/>
</td>
</tr>
</body>
</html>
Both images are 200 pixels wide but the second is moved 100 pixels left,
therefore the total width of the table required is 300 pixels. However,
as can be seen in a browser the table width is 400 wide, enough to
accommodate both images side by side.
Despite numerous attempts I cannot seem to make my browser realise that
it does not need all of the space due to one image having been
relatively positioned.
Could anyone please shed any light onto this, and solutions, any
alternatives? I did try adding the transparent image outside of the
table and them moving it into the correct place in Java script however,
the browser still leaves the required space at the position in the
document that I originally place the image.
Thank you to anyone who replies,
Stephen Weatherly