[Home]Space between images

HomePage | RecentChanges | Preferences | Newbie Help

Category HTML FAQ

http://www.htmlhelp.com/faq/html/all.html#image-nospace

chan555 says: Having images 'adjacent' to each other is another issue and the solution greatly depends on where the images are in relation to each other. Usually 'getting rid of the spaces between them' either involves making sure that there is no space inbetween the <img> tags and the surrounding tags. Most people use tables to hold a group of images together with the cellspacing and cellpadding set to zero and no spaces between the <img> and <td> tags.

Over simplified examples:

(will produce spaces):
<table border="0">
  <tr>
    <td>
       <img>
    </td>
  </tr>
  <tr>
    <td>
      <img>
    </td>
  </tr>
   :
</table>

(most likely will produce spaces):
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
       <img>
    </td>
  </tr>
  <tr>
    <td>
      <img>
    </td>
  </tr>
   :
</table>

(will not produce spaces between images:)
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><img></td>
  </tr>
  <tr>
    <td><img></td>
  </tr>
   :
</table>

(will not produce spaces between images or between rows:)
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><img></td></tr><tr><td><img></td></tr>
   :
</table>

If your line get long you can add a line return within the tags:
  <td><img src="somePicture.gif" border="0"
        height="30" width="120" alt="Home"></td>
I hope that's not too 'geek' for you ;-)


Comments --

Tables, Images, and Mysterious Gaps http://devedge.netscape.com/viewsource/2002/img-table/


HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited August 18, 2002 6:42 am (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media