Solved

table question

Posted on 2002-04-05
9
131 Views
Last Modified: 2010-04-09
if I have an image in a table tag like so:

<table border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td><img src="myimage.gif">
    </td>
  </tr>
  <tr>
    <td><img src="myimage.gif">
    </tD>
  </tr>
</table>

there is always about a 2 pixel space between the first image and the 2nd image ... is there a way I can get those images to completely connect like if i did this:

<img src="myimage.gif"><br>
<img src="myimage.gif">

i've looked in style tags and things like that and can't figure out anything .. any help?

thanks,
0
Comment
Question by:SeanGraflund
9 Comments
 
LVL 19

Accepted Solution

by:
webwoman earned 50 total points
ID: 6920806
Take out the space before/after the td tags. Make sure you set border=0 on the images. Set the size of the images and the size of the table. The size of the table should equal the total of the image widths.

Just taking out extra spaces and making sure border on images is 0 should do it, though. And make sure that there's not any border on the actual graphic.
0
 
LVL 18

Expert Comment

by:bruno
ID: 6920886
in other words...





<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="myimage.gif" border="0"></td>
  </tr>
  <tr>
    <td><img src="myimage.gif" border="0"></td>
  </tr>
</table>
0
 
LVL 1

Expert Comment

by:GorGor1
ID: 6922272
Like the other guys have said, the carriage return before the </td> is what is giving you the space.  I ran into this when I first started with tables and it drove me NUTS until I figured it out.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:mouatts
ID: 6923302
You are still likely to get a one pixel gap in Netscape. One of its many one pixel bugs.

Steve
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6923410
You shouldn't. If you did, none of the slicing tools from the graphics programs would work. They work just fine, with no gaps in either IE or Netscape.

FRAMES can give you gaps. Not tables. Not if they're set up right.
0
 
LVL 1

Expert Comment

by:GorGor1
ID: 6923485
WW is right.  But then she already knows she is.  If you leave no space between your table data and the closing </td>, you will get NO pixel gap.  I've made tables that would definitely not turn out right if there was 1 pixel gap at the end of each cell and they worked fine in netscrap.
0
 
LVL 1

Author Comment

by:SeanGraflund
ID: 6925097
thanks webwoman!

i've been working on this problem for over a day and couldn't figure it out! ..

amazing how simple the solution was!

Sean
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6926778
Well, next time you'll know! We all fight with tables. I've probably made every mistake you can with them at least a dozen times. And that's just today. ;-)

Thanks for the A!
0
 
LVL 1

Expert Comment

by:GorGor1
ID: 6926812
and now you know...and knowing is half the battle :o)~
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html border input line 7 25
Bootstrap 3 - Style a dropdown 1 25
..ignore the Question 1 21
Send email using HTML and PHP in separate file 5 36
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question