You have to look at all the forces acting on the box, the downward force of gravity (mg) and the force along the rope.
The force exerted by the rope has both an upward component ($12 \sin θ$) and a horizontal component ($12 \cos θ$). You will see that the upward component of the force of the rope plus the upward reaction force of the table, equals the downward force of gravity, so there is no net vertical component of force and therefore no vertical acceleration.
Since there is no friction opposing the horizontal component of the rope force, the box will accelerate horizontally
$$a=\frac{12\cosθ}{2}=3\frac{m}{s^2}$$
Hope this helps.