当我将“canvas”标签放在“td”标签内时,它会自动增加列宽,有很多填充。我希望我的画布完全适合表格单元格。
这是我的CSS!
.mainTable{
width:100%;
height: 1000px;
border: 1px solid black;}
td{
border: 1px groove black;
padding: 1px;}
#animationCanvas_1{
background-color: black;}
有人请帮帮我!
<table class="mainTable">
<tr id="headingTable">
<th></th>
<th></th>
<th></th>
</tr>
<tr id="rowFirst"> <!-- reflecting balls -->
<td>
<canvas id="animationCanvas_1">
</canvas>
</td>
<td></td>
<td></td>
</tr>
<tr id="rowSecond"> <!-- growing circle with changing color -->
<td></td>
<td></td>
<td></td>
</tr>
<tr id="rowThird"> <!-- animation with css only -->
<td></td>
<td></td>
<td></td>
</tr>
<tr id="rowFourth"> <!-- random rectangle -->
<td></td>
<td></td>
<td></td>
</tr>
<tr id="rowFifth"> <!-- rotating objects -->
<td></td>
<td></td>
<td></td>
</tr>
</table>