<? set i 1 puts "<table>" while { $i <= 8 } { puts "<tr>" for {set j 1} {$j <= 8} {incr j} { set num [ expr {$i * $j * 4 - 1} ] puts [ format "<td bgcolor=%2x%2x%2x > $num $num $num </td>" \ $num $num $num ] } incr i puts "</tr>" } puts "</table>" ?>