The MB doesn't parse out whitespace like normally happens with HTML. If you format your code and put all the tags on new lines with tabs to indent it and whatnot, the MB will put the newlines in there. In HTML when you put text between a </tr> and a <tr> for example, it'll throw that text to either before or after the table. So that's what's happening. Pretty sure anyways. That's what it does with normal text in posts. Try putting <table><tr><td>blah</td></tr> instead of putting all the tags on separate lines.