Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 726
r1nzler Avatar asked Jan 23 '26 20:01

r1nzler


1 Answers

you can try and add this to your CSS:

td {
  line-height: 0;    
}​

should solve it.

like image 86
samura Avatar answered Jan 26 '26 11:01

samura