5

Hello i'm trying to build a table cell using div tag and while doing so. i get this extra spacing after my img a tag within the cell.

<div display:table>
 <div display:row>
  <div display:tabel-cell>
   <a><img/></a>

I can't seem to figure out how to get rid of that extra spacing.

i tried display:inline for the a and img tag. yet not luck.

if anyone can help me get rid of this spacing i would gladly appreciate it.

Example -- right before the shadowing there a 2-3 pixel white space within this tabel-cell

http://i.imgur.com/DLPWH.png

Tom
  • 149
  • 2
  • 4
  • 11

3 Answers3

17

Aside from the fact that you should use tables for tabular data, I think that setting display: block on the image will remove the space. If that doesn' work, try to make a jsFiddle page to show off the problem.

deviousdodo
  • 9,177
  • 2
  • 29
  • 34
  • Hey thanks it worked. i totally forgot about block. I was thinking of using tables but dont know if there a difference. – Tom Oct 11 '11 at 22:34
  • Yeah, hear you about "tables for data", but you try telling that to almost every email client out there when you're coding an email that you'd like to display reasonably nicely on most platforms... – ElBel Nov 02 '12 at 17:48
2

That space can be removed using:

style="display:block;"
0

Try setting margin: 0 and padding: 0 on the elements that have this extra spacing. It is usually a good idea to implement some sort of CSS Reset to make sure all elements are cleared of these annoying default attributes such as margins and padding.

Logan Serman
  • 29,447
  • 27
  • 102
  • 141