This is my current table:

Each cell can only move if it has a white cell next to it, and proceed to switch positions with that white cell. (I'm trying to do the Parking Lot puzzle game). I'm not sure if using a table is the right choice, is there an easier way to do this? Here is what I have so far:
<table style="width: 650px; height: 600px; border: 1px solid #000000">
<tbody>
<tr style="height: 23px;">
<td style="width: 24px; height: 23px; background-color: blue" ></td>
<td style="width: 24px; height: 23px;"></td>
<td style="width: 24px; height: 23px;background-color: blue" colspan="2"></td>
</tr>
<tr style="height: 23px;">
<td style="width: 49px; height: 23px; background-color: green" rowspan="2"></td>
<td style="width: 24px; height: 23px;background-color: red" rowspan="2"></td>
<td style="width: 24px; height: 23px; background-color: yellow"></td>
<td style="width: 24px; height: 23px;background-color: yellow"></td>
</tr>
<tr style="height: 23px;">
<td style="width: 24px; height: 23px;background-color: yellow"></td>
<td style="width: 24px; height: 23px;background-color: yellow"></td>
</tr>
<tr style="height: 23px;">
<td style="width: 24px; height: 23px; background-color: blue" ></td>
<td style="width: 24px; height: 23px;"> </td>
<td style="width: 24px; height: 23px;background-color: blue" colspan="2"></td>
</tr>
</tbody>
</table>