For y = 0 To nCols-1
TextWindow.BackgroundColor = y
For x = 0 To nCols-1
TextWindow.ForegroundColor = x
str = spc[1] + y +","+ x
TextWindow.Write(str + spc[w-Text.GetLength(str)])
If x = 7 Then
TextWindow.BackgroundColor = bg
TextWindow.ForegroundColor = fg
TextWindow.WriteLine(spc[2]+ y +"="+ cols[y] +" ("+ hex[y] +")")
TextWindow.BackgroundColor = y
EndIf
EndFor
TextWindow.BackgroundColor = bg
TextWindow.ForegroundColor = fg
If y = 7 Then
TextWindow.WriteLine(spc[1] + ul) ' nbsp + ul)
Else
TextWindow.WriteLine(spc[1]) ' nbsp)
EndIf
EndFor