Mystery white space before a table
I was trying to debug some mystery white space that was appearing on a page before a table. For some reason the source code showed nothing before the table, but the display didn't agree.
Using FireBug (an add-on to firefox that i HIGHLY recommend) I was able to see that FFox thought that white space should be there because of some BR tags. Curious. I couldn't find them anywhere.
Finally tracing through I ran into a much more obfuscated version of this:
for (int i=0; i<contents.length; i++){
out.println("<tr><td>" + contents[i] + "</td></tr><br>");
}
Note the BR on the end there. That's not valid. Apparently FFox handled this bad code by kicking the BRs to the head of the table. A simple fix to a problem that had me in mug busting mood BIG TIME.
0 Comments:
Post a Comment
<< Home