Dreamweaver will format HTML code however you would like it displayed. For example, if you use 3 spaces to indent, but never indent IMG tags, you can specify that formatting information in the code rewriting options. Then you go to the Commands menu and choose "Apply Source Formatting". This is a great way to get code written by someone else into a format familiar to you.
A feature that many HTML coders don't know about or don't use is the ability to collapse HTML code. This does not remove the tags from the document, but just remove them from view so that they aren't distracting to what you're working on. To collapse your code:
- Select the section of code you want to hide
- In the Edit menu, choose "Collapse Selection" from the "Code Collapse" sub-menu
An easier way is to select the code and then click on the code collapse icons that appear in the gutter. You can also right click on the selected code and choose "Collapse Selection".
If you want to hide everything except what is highlighted, choose "Collapse Outside Selection" in any of the above methods.
To expand collapsed code, simply double click on it. This opens the code up, and selects it. Then you can move that selection or delete it or add additional tags around it.
I use the collapse and expand feature all the time on pages where I don't want to edit the external template. I just select the content area I want to edit and collapse outside. Then I write my HTML. You can still view the page in Design view or preview it in a browser. The collapsed code is not removed from the document, simply hidden from view. I also use it when I'm working on a series of items. When I've finished one, I collapse it. I know I'm done when there is no code showing.

