Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,807 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,270 people online right now. Registration is fast and FREE... Join Now!




Tables must die!

 
Reply to this topicStart new topic

Tables must die!, in desperate need of help with this table

Andora
23 Aug, 2008 - 06:04 PM
Post #1

D.I.C Head
**

Joined: 18 Aug, 2008
Posts: 105


My Contributions
Here is my code:
CODE
<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#FFFFFF"><img src="./numbers/1.bmp" alt="1"border="0"/></td>
<td bgcolor="#FFFFFF"><img src="./numbers/2.bmp" alt="2"border="0"/></td>
</tr>
</table>
1.bmp and 2.bmp are 15x15 monochrome bitmaps. For some reason each of the cells are 15 wide and 19 tall. Why isn't it 15 tall!? How can I fix this? This has been a huge frustration for me using tables.

Your help is greatly appreciated.

P.S. It appears to work in IE7. However FireFox3, Safari, Netscape9, and Opera9.52 do have the problem.

EDIT: Setting height="15" does not work.

This post has been edited by Andora: 23 Aug, 2008 - 10:01 PM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Tables Must Die!
23 Aug, 2008 - 06:25 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,478



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
1st off, the width can only be set with the 1st td. All the ones after that follow suite.
2ndly, when working with Tables, I find it's easiest to set the border to 1, & that makes troubleshooting the layout a lot easier.

When you place the images into the table data, the table data is going to stay it's size, & only that portion of the image will display. If you must have the entire image, you may need to start another table inside of that td.
User is online!Profile CardPM
+Quote Post

Andora
RE: Tables Must Die!
23 Aug, 2008 - 06:34 PM
Post #3

D.I.C Head
**

Joined: 18 Aug, 2008
Posts: 105


My Contributions
QUOTE
When you place the images into the table data, the table data is going to stay it's size, & only that portion of the image will display. If you must have the entire image, you may need to start another table inside of that td.
Erm... the cell is too big not too small. For some reason when I put images in tables aditional pixels are added to the height of the table. I want the table cell to be exaclty the same size as the image inside it.

This post has been edited by Andora: 23 Aug, 2008 - 06:35 PM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Tables Must Die!
23 Aug, 2008 - 06:36 PM
Post #4

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,478



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
This is unrelated, but why are you using BMP files?

Also, your ALT tabs are a bit goofed up.

CODE

<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#999999" width="15"></td>
<td bgcolor="#FFFFFF"><img src="./numbers/1.bmp" alt="1" border="0"/></td>
<td bgcolor="#FFFFFF"><img src="./numbers/2.bmp" alt="2" border="0"/></td>
</tr>
</table>

User is online!Profile CardPM
+Quote Post

Andora
RE: Tables Must Die!
23 Aug, 2008 - 06:40 PM
Post #5

D.I.C Head
**

Joined: 18 Aug, 2008
Posts: 105


My Contributions
QUOTE(no2pencil @ 23 Aug, 2008 - 07:36 PM) *
This is unrelated, but why are you using BMP files?
Well, believe it or not it is much smaller. It's only 15x15 and it only has black and white so I found a 2 color bitmap is much smaller than a gif.
QUOTE(no2pencil @ 23 Aug, 2008 - 07:36 PM) *
Also, your ALT tabs are a bit goofed up.
Fixed the alt tags, didn't solve the problem though.
User is offlineProfile CardPM
+Quote Post

Andora
RE: Tables Must Die!
24 Aug, 2008 - 07:38 PM
Post #6

D.I.C Head
**

Joined: 18 Aug, 2008
Posts: 105


My Contributions
Woo Hoo! I have found the solution on my own.

For anyone else having a similar problem: http://developer.mozilla.org/en/Images,_Ta...Mysterious_Gaps

biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 02:28PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month