r1nzler
r1nzler

Reputation: 2533

html remove space from table row

I want to create a 3 x 3 table with no spaces in between the the rows AND columns. At the moment, I set cellspacing and cellpadding both to zero, but I still get some space between the rows. I posted a picture of what it looks like. See the space between the rows? How do I get rid of that?

I posted an image of what the space between the rows

Okay here's my code:

<!DOCTYPE html>
<html>
<body>

    <table border="0" cellpadding="0" cellspacing="0" >

    <tr >
       <td><img src="bgimage.png" /></td>
       <td><img src="bgimage.png" /></td>
       <td><img src="bgimage.png" /></td>
    </tr>
    <tr >
      <td><img src="bgimage.png" /></td>
      <td><img src="bgimage.png" /></td>
      <td><img src="bgimage.png" /></td>
   </tr>
   <tr >
     <td><img src="bgimage.png" /></td>
     <td><img src="bgimage.png" /></td>
     <td><img src="bgimage.png" /></td>
  </tr>
 </table>

Any help in removing the space between the rows would be greatly appreciated.

Upvotes: 3

Views: 4198

Answers (1)

samura
samura

Reputation: 4395

you can try and add this to your CSS:

td {
  line-height: 0;    
}​

should solve it.

Upvotes: 9

Related Questions