Если уж на то пошло:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="tmp.css" />
<style type="text/css">
</style>
<script type="text/javascript">
window.onload = function() {
var tab = document.getElementsByTagName('table'), i = tab.length;
while(i--){
var tr = tab[i].getElementsByTagName('tr'), j = tr.length;
while(j--) tr[j].style.background = j%2 ? 'red' : 'yellow'; //а на хрена козе баян?
}
}
</script>
</head>
<body>
<table>
<tr>
<td>1</td>
</tr>
<tr>
<td>2</td>
</tr>
<tr>
<td>3</td>
</tr>
<tr>
<td>4</td>
</tr>
</table>
</body>
</html>