Thanks for the replies.
The problem is, indeed, like what Ben said, form margin. Browsers tend
to leave blank spaces before and after forms. This usually would not be
a problem but when the form is in a table, this would double the row height.
The solution is to set the form margin to zero.
The following site has a detailed explanation.
http://www.cs.tut.fi/~jkorpela/forms/extraspace.html