Q:

How to colorize a part of table

I got this code which shows multiplication table, and I should make a diagonal of colored squares, but surely I do not know how. Could anyone help me?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Task1
{
    class Program
    {
        static void tab(byte b)
        {
            Console.WriteLine("It's {0} x {0}\n", b);
            // Rows
            for (int i = 1; i <= 10; i++)
            {
                // Columns
                for (int j = 1; j <= b; j++)
                Console.Write("{0}\t", j * i);
                Console.WriteLine();
            }
            Console.WriteLine();
        }
        static void Main(string[] args)
        {
            tab(10);
        }
    }
}

A:

If it's truly b x b then your rows loop should be <= b not 10.
On the matter at hand, your diagional occurs when i == j, so that would be your conditional on which you need to colorize.
If you need help colorizing, use the Console.BackgroundColor member to set that. Don't forget to change it back when you're done with a colored box.

