Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extra white space on table cells

enter image description here

I am creating a table with 5 images across, one in each cell. I want it to span 920px, with 10px gap between each cell. Which equals 176 for each cell, so I made my images 176px wide.

This is my html and CSS:

    <table>
    <tr>
        <td><a class="fancybox-effects-c" rel="group" href="images/newhomes_02.jpeg" title="New Home Number Two"><img src="images/thumb_newhomes_01.gif" class="fade" alt="" /></a></td>
        <td><a class="fancybox-effects-c" rel="group" href="images/newhomes_02.jpeg" title="New Home Number Two"><img src="images/thumb_newhomes_01.gif" class="fade" alt="" /></a></td>
        <td><a class="fancybox-effects-c" rel="group" href="images/newhomes_01.jpeg" title="New Home Number Three"><img src="images/thumb_newhomes_01.gif" class="fade" alt="" /></a></td>
        <td><a class="fancybox-effects-c" rel="group" href="images/newhomes_02.jpeg" title="New Home Number Four"><img src="images/thumb_newhomes_01.gif" class="fade" alt="" /></a></td>
        <td><a class="fancybox-effects-c" rel="group" href="images/newhomes_01.jpeg" title="New Home Number Five"><img src="images/thumb_newhomes_01.gif" class="fade" alt="" /></a></td>
</table>



table {
    width:100%;
    cell-padding:"0";
    cell-spacing:"0";
    margin:0;
    border:none;
}

td {
    width:176px;
}

You can see in my attached image. that there is this white space on right side inside each cell. I thought cell-padding and cell-spacing would fix it, but it didn't. Even doing td a set witdth of 176px didn't work. What am I doing wrong? Is there a better method?

like image 276
Adam G Avatar asked Dec 26 '22 05:12

Adam G


1 Answers

You need cellpadding and cellspacing in table tag

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

DEMO

like image 113
Sowmya Avatar answered Dec 28 '22 21:12

Sowmya