because the following code also works the same:
That's not true. \n is a new line, equivalent to pushing enter in your browser. Look at the following code
this
is
html
code
You know what HTML processes that as in your browser?
this is html code
Why? There are no <br> tags. I can hit enter and space as many times as I want; spaces mean nothing in HTML. It helps you organize your code. Essentially, what \n does is the same as pushing enter.
echo "<tr>\n<td width=200>\ncode\n</td>\n</tr>\n";
will print in html as
<tr>
<td width=200>
code
</td>
</tr>
If you want a line break, which is completely different, in html you wouldn't write
hello
world
to have it print that way. You would write
hello<br>world
Hope this clears up any confusion.
Cgraz