Re: images in tables

by "Ramon Bartschat" <bartschat(at)goldnet.sk>

 Date:  Sat, 17 Apr 1999 09:35:20 +0200
 To:  "Html Writers Guild Graphics Discussion Group" <hwg-graphics(at)hwg.org>
  todo: View Thread, Original
>Thanks to all of you who responded to my questions about sizes of images
for
>faster loading.... and other things.  I now have a new question.  Also,
>before I wrote this, I went to the archives and got a large list of "images
>in tables", but when I clicked on each thing, it only went to a blank
>page....so don't know what is wrong there.
>
>I'm trying to do a table with two cells across in a row.  The left cell has
>a small image and I want it to align right and valign top.  The right cell
>has a large paragraph of text which is much longer than the image.  I want
>it to align left.  I want both the image and the text to valign to the top,
>so when you look at the row, both the top of the image and the first line
of
>text line up with each other.  I'm doing this as a table because I don't
>want the text to wrap around the image.
>
>I tried using the <tr valign=top> to make both cells in the row to be at
the
>top... but this isn't working.  I have also tried separate instructions for
>each cell <td valign=top> but that didn't work either.  It still looks like
>the image is lower than the top line of text.  Is there a trick to getting
>an image to line up in one cell with the text in the next cell?
>
>Also, while we are at it.. how can I get the text to move a little farther
>to the right away from the image?  Is there a way to add some space between
>the two cells with cell padding or something?  I'm a little lost if I get
>too deeply into tables...sorry :))



 Hi Lonna


I had (or have) the same problem. I use heavily tables for everything.
In M$IE and Opera everything looks all right and the table rendering is like
it should.
Netscape always "screws" up. I don't know why I have the biggest of problems
aligning properly Tables in Netscape. (I use version 4.5).
I am very sad about this for I am not a M$ fan, I'd rather take the sides
with Netscape.

What browser or browsers do you use?

As for your graphic
<td valign=top> SHOULD work. unless you have some border defined around your
image.

IMO your problem must be not in HTML coding but in the spacing you apply to
the HTML code.
Spacing? yes Spacing?
The cell code for the image should look like this:
<TD VALIGN="TOP" ALIGN="LEFT" WIDTH="yyy"><IMG SRC="xxxx" WIDTH="yyy"
HEIGHT="zzz" ALT="Image"></TD>
Notice there are no unneccesary spacing or line breaks.
It is very important to place the closing </TD> tag immediately after the
content of the cell, -in my example after the IMG tag. If you put the </TD>
tag in a different line some browsers will add a little space around the
image.


My advice also:
- use CELLSPACING=0 and CELLPADDING=0 for better control
- use the <TD WIDTH=x> attribute to define the width of both cells.
- for reasons unknown to me by using the NOWRAP attribute in the smaller
cell (in your case the one with the image I suppose) will also help to
render correctly in some browsers.


Hope this helps.

Ramon

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA