You don't explain why you're trying to edit HTML with TextEdit. I'm curious.
I am partial to Dreamweaver for my HTML coding needs.
Coda by Panic comes highly recommended, and is a sight cheaper than Dw.
You want free? TextWrangler is a free download.
Also, TextEdit might work out better if you change to "Plain Format" in TextEdit>Preferences.