Activation view: generate decent code

Removed broken html (unopened anchors, missing opening tbody, missing
closing table), added new lines and code folding.