/    Sign up×
Community /Pin to ProfileBookmark

images in a table – i want the two images to touch

is there a way i can eliminate all the space between two rows in a table? i want the image in the top row to touch the image in the row below it. i have cell padding and cell spacing at zero and the border at zero. what else do i need to do?

to post a comment
HTML

10 Comments(s)

Copy linkTweet thisAlerts:
@web-eagleMar 20.2003 — You might also want to look at the height and width parameters of each cell to make sure they match your image size. It’ll look something like

<td width="100" height="120">

This shouldn’t be necessary, but sometimes it is.

If it’s not critical that the images be in separate cells you might try putting them in the same cell with a line break <br> between them.
Copy linkTweet thisAlerts:
@NedalsMar 20.2003 — You may be getting small spaces between your images. The 'trick' to solve this is to make sure that your </td> is on the same line as your image tag.

<tr>

<td>

<img src="image.gif">

</td>

</tr>

....gaps

<tr>

<td>

<img src="image.gif"></td>

</tr>

.... no gaps
Copy linkTweet thisAlerts:
@gil_davisMar 20.2003 — There is also a border on the image that you can set to zero.
Copy linkTweet thisAlerts:
@podunkauthorMar 20.2003 — [i]Originally posted by nedals [/i]

[B]You may be getting small spaces between your images. The 'trick' to solve this is to make sure that your </td> is on the same line as your image tag.

<tr>

<td>

<img src="image.gif">

</td>

</tr>

....gaps



<tr>

<td>

<img src="image.gif"></td>

</tr>

.... no gaps [/B]
[/QUOTE]




This was my problem!

Thanks alot, my site looks awesome now :o)
Copy linkTweet thisAlerts:
@BeauchampMar 21.2003 — Hi

You can also use <td valign=bottom> for the top row and valign=top for the bottom row.
Copy linkTweet thisAlerts:
@jdaviaMar 22.2003 — [i]Originally posted by podunk [/i]

[B]is there a way i can eliminate all the space between two rows in a table? i want the image in the top row to touch the image in the row below it. i have cell padding and cell spacing at zero and the border at zero. what else do i need to do? [/B][/QUOTE]

Here is a very simple trick that I use when I cut up an image.

Do not use a table to set the images.

Instead use this code to set the images and insert it in a table if needed.

Use no spaces, add a <BR> for a new row. You can include the image sizes and I think the "alt"

<TABLE border=0>

<TR>

<TD>

<IMG SRC="one.gif"HSPACE=0"VSPACE=0"BORDER="0">

<IMG SRC="rwo.gif"HSPACE=0VSPACE=0"BORDER="0"><BR>

<IMG SRC="three.gif"HSPACE=0VSPACE=0"BORDER="0">

<IMG SRC="four.gif"HSPACE=0VSPACE=0"BORDER="0"><BR>

<IMG SRC="five.gif"HSPACE=0VSPACE=0"BORDER="0">

<IMG SRC="six.gif"HSPACE=0VSPACE=0"BORDER="0">

</TD>

</TR>

</TABLE>
Copy linkTweet thisAlerts:
@NedalsMar 23.2003 — jdavia,

If you use the code exactly as posted you will get spaces around your images. (I copied and pasted your code and tried it!). The trick is to NEVER follow an image tag with a 'return'.

<TABLE border=0>

<TR>

<TD>

<IMG SRC="........"><IMG SRC="......."><BR>

<IMG SRC="........"><IMG SRC="......."><BR>

<IMG SRC="........"><IMG SRC="......."></TD>

</TR>

</TABLE>

Re-layout like this and you will have no spaces.
Copy linkTweet thisAlerts:
@jdaviaMar 23.2003 — [i]Originally posted by nedals [/i]

[B]jdavia,

If you use the code exactly as posted you will get spaces around your images. (I copied and pasted your code and tried it!). The trick is to NEVER follow an image tag with a 'return'.

[/B]
[/QUOTE]

You are right. And I mentioned that. My mistake was to make it look good in the post that I did make returns.

I think the Hspace, Vspace , and no border should still be included.

Thanks for being sharp
Copy linkTweet thisAlerts:
@khakiMar 23.2003 — Hi Guys...

All this chitter-chatter about positioning images with.... [I]gasp![/I] ...[B][I]tables[/I][/B] (wink).

<div>s will put 'em exactly where you want 'em. Butt-up, overlapping, you name it.

There really is no need to use tables for positioning images.

<div> positioning does it with less code and with greater control and accuracy.

(that's my 2 cents)

big spender...

k
×

Success!

Help @podunk spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...