I'm trying to build a grid in html but I want to remove spaces between my cells, and I can't find.
<table id="gameGrid" cellspacing="0" >
<tr class="gridRow" >
<td class="box" ></td>
<td class="box" ></td>
<td class="box" ></td>
</tr>
<tr class="gridRow" >
<td class="box" ></td>
<td class="box" ></td>
<td class="box" ></td>
</tr>
<tr class="gridRow" >
<td class="box" ></td>
<td class="box" ></td>
<td class="box" ></td>
</tr>
</table>
and the CSS:
#gameGrid{
border:1px solid black;
border-collapse: collapse;
padding:0;
margin:0;
border-spacing: 0;
}
#gameGrid .gridRow{
margin:0;
padding:0;
}
#gameGrid .gridRow .box{
margin:0;
padding:0;
background-color:green;
height:16px;
width:16px;
display:inline-block;
}
an example: http://jsfiddle.net/sLG2D/1/
I saw this post but nothing works How to remove unwanted space between rows and columns in table?
Remove the display:inline-block;
rule from #gameGrid .gridRow .box
.
jsFiddle example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With