0

I put two tiny images (8px) in a table with no cell padding, but there still is padding above and below the pictures. This only happens with images below a certain size. Why?

<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td><IMG SRC="http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Star.svg/8px-Star.svg.png"></td>
</tr>
<tr>
<td><IMG SRC="http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Star.svg/8px-Star.svg.png"></td>
</tr>
</table>
octosquidopus
  • 3,517
  • 8
  • 35
  • 53

1 Answers1

2

It's because the image is inline and thus renders at the current line-height.

Set line-height to 8px or set the image to block:

td {
    line-height: 8px;
}

or ..

td img {
    display: block;
}
Kevin Boucher
  • 16,426
  • 3
  • 48
  • 55