我想在html中構建網格,但我想刪除我的cels之間的空間,我找不到。創建一個網格,沒有空格使用表格html
<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>
和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;
}
個例:http://jsfiddle.net/sLG2D/1/
我看到了這個帖子,但沒有任何工程 How to remove unwanted space between rows and columns in table?
感謝
謝謝你很容易 – Ajouve 2013-05-08 14:02:38