How to quickly apply color schemes to spreadsheet rows with OpenOffice

How do you quickly create a spreadsheet where, for example, every other line has a background of a different color? Here are a couple of methods.

The first one is faster (and works even in controlled environments where you can't install extensions) if you want white rows alternated with colored ones. The second trick is more flexible, but doesn't refresh coloring when you add or delete rows.