You are here: irt.org | FAQ | JavaScript | Table | Q1462 [ previous next ]
Try:
<script language="JavaScript"><!-- var X = 7; var Text = '<table><tr>'; var Cells = 100; for (i=1;i<=Cells;i++) { if (i%X==0) Text += '<td><font color="red">' + i + '</font></td>'; else Text += '<td>' + i + '</td>'; if (i%10 == 0 && i<Cells) Text += '</tr>\n<tr>'; } Text += '</tr></table>' document.write(Text); //--></script>