How do you ensure a <td> is exactly 200px tall?

Posted by George Edison on Stack Overflow See other posts from Stack Overflow or by George Edison
Published on 2010-03-25T20:55:27Z Indexed on 2010/03/25 21:03 UTC
Read the original article Hit count: 323

Filed under:
|
|
|

I have a table with an image inside:

<table style="border: 3px solid rgb(0, 0, 0); width: 800px; background-color: rgb(255, 255, 255); margin-left: auto; margin-right: auto; border-collapse: collapse;">
 <tbody>
  <tr>
   <td style="text-align: center; padding: 0px; margin: 0px;"><img style="width: 800px; height: 200px; border: 0px;" alt="Logo" src="logo.png">
   </td>
  </tr>
 </tbody>
</table>

No matter what I do, there is still a little sliver of white at the bottom of the image. A quick check with Chrome's Inspector reveals that the td has a height of 204px!

How can I force the td to be the same height as the image?

As you can see above, I've tried all sorts of things...

© Stack Overflow or respective owner

Related posts about css

Related posts about html