Yes. The web browser does not pay any attention to spaces or new lines (except inside <pre> and </pre>.
Some Web authors prefer to create their tables in the style of the question. Web design tools (such as Dreamweaver usually produce HTML that looks like that. They use indenting to show the role of the text on each line. Here is a nice table:
Barium | Yellow |
Boron | Green |
Sodium | Yellow |
Strontium | Red |
Edit the following to create the table: