Last but not least, dynamic changes to HTML formatting are often a source of confusing hard-to-debug problems.
- Always use a CSS class or HTML ID attribute to indicate which elements should be acted upon. This will prevent your code from modifying the elements that should not be changed.
- Define all changes to the page formatting as CSS rules and make the rules as specific as possible (for example, use TABLE.printout TR.EvenRow instead of just .EvenRow). Do not modify the style properties of individual HTML elements unless it’s absolutely necessary, as this will make your code more complex and harder to change.