View Full Version : Spacing problem with tables.

01-06-2008, 03:37 AM
Okay, I have looked evrywhere to see whats wrong with my code.
There is a space between the cells in my tables website layout. Can someone tell me how to fix it.

Here is my code.

<title>//{Recycled Material}</title>

<body background="bodybg.png";>

<table border="0" cellpadding="-1" cellspacing="-1" align="left" width="750" valign="top" style="position: absolute; top:-5px; left:250px;">
<td align="center" valign="top" ><img src="ajordan.png" cellpadding="0" cellspacing="0" width="366" height="90"></td>
<td align="center" valign="top" ><img src="ashane.gif" cellpadding="0" cellspacing="0" width="384" height="90"></td>
<td align="center" valign="top"><img src="Abengi.gif" cellpadding="0" cellspacing="0" width="366" height="98"></td>
<td align="center" valign="top"><img src="aderek.gif" cellpadding="0" cellspacing="0" width="384" height="98"</td>
<td align="center" valign="top"><img src="abradley.gif" cellpadding="0" cellspacing="0" width="368" height="94"></td>
<td align="center" valign="top"><img src="ajeff.gif" cellpadding="0" cellspacing="0" width="382" height="94"></td>
<td align="center" valign="top" ><img src="abill.gif" cellpadding="0" cellspacing="0" width="368" height="84"></td>
<td align="center" valign="top"><img src="amike.gif" cellpadding="0" cellspacing="0" width="382" height="84"></td>
<td align="center" valign="top"><img src="ajoek.gif" cellpadding="0" cellspacing="0" width="370" height="98"></td>
<td align="center" valign="top"><img src="adakota.gif" cellpadding="0" cellspacing="0" width="380" height="98"></td>



Here is a screen capture:

As you can see there is a space between the columns. Can anyone help me get rid of that?

01-06-2008, 10:34 AM
Difficult to sort this without access to the url so we can see how the images fit.

A few comments though:

Can cellpadding/spacing take negative values?
I always thought that cellpadding/cellspacing were properties of the table, not the individual cells.
Some browsers put spaces in if there is white space between the image tag and enclosing tags. However, I cannot see any such here. What browser are you using?

The whole table would be better styled with a stylesheet rather than inline attributes.


01-06-2008, 11:58 AM
No, you can't have negative attributes in cellpadding and cellspacing. That maybe the problem right there, but no guarantee because I can't test it. Make both attributes 0 and see if that doesn't help. If not, give us a URL. It can make figuring out your problem much easier.

Also, cellpadding and cellspacing cannot be used in the <img> tag.