<!DOCTYPE html>
<HTML><HEAD><TITLE>Таблица с чередованием строк по цвету текста и фона через скрипт</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
</HEAD><BODY onload="colourRows() ; colourCells() ; colourCols()">
<script type="text/javascript">
function colourRows(){
rowEl=document.getElementById("tab").getElementsByTagName("tr")
for(var rowCount=0; rowCount<rowEl.length; rowCount++){
if((rowCount+1) % 2 == 0) {
rowEl[rowCount].style.backgroundColor="gray"
rowEl[rowCount].style.color="red"
}
else{
rowEl[rowCount].style.backgroundColor="yellow"
rowEl[rowCount].style.color="blue"
}}}
</script>
<CENTER> <TABLE id="tab" border="1" cellspacing="0"><TR align="center"><TD width="70">Alternate</TD><TD width="70">Coloured</TD><TD width="70">Rows</TD><TD width="70">And/Or</TD><TD width="70">Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR><TR align="center"><TD>Alternate</TD><TD>Coloured</TD><TD>Rows</TD><TD>And/Or</TD><TD>Text</TD></TR></TABLE></CENTER>
</BODY></HTML>