I faced the same problem many times. The reason turned out to be an additional character outside </td> tags. HTML formating software like Dreamweaver, HTML Tidy, Notepad++ will be helpful in these cases. Above all use HTML Validatior extension for firefox. Any ways this question has got nothing to do with PHP. Regarding firebug, it shows the "generated" code, or the code seen by the browser, but not the source code.