Here is the exact method I used in my (dynamic) tic-tac-toe game. It's dynamic in the sense that you can play on a board from size 3 to size 9.
Code:
int map::display(short x, short y)
{
short x_coord, y_coord;
short repos_x, repos_y;
for(short h = 0; h < size; h++)
{
for(short i = 0; i < size; i++)
{
if(grid[i][h] == 'X' || grid[i][h] == 'O')
{
gotoxy(value_x[i][h]-1, value_y[i][h]);
cout << " ";
if(grid[i][h] == 'X')
{
textcolor(LIGHTBLUE);
cout << grid[i][h];
textcolor(LIGHTGRAY);
}
else if(grid[i][h] == 'O')
{
textcolor(LIGHTRED);
cout << grid[i][h];
textcolor(LIGHTGRAY);
}
/* else
cout << grid[i][h]; //unneccessary */
cout << " ";
}
}
}
gotoxy((size*2)+size-1, (size*2));
}
You can download the game/source by following the link in my site. There is a lot of code in the game, because I made it in console and I put a lot of extra stuff in there to liven up the game. You should be able to find an effective way to display the grid by referring to my source. Good luck.
EDIT: hmm I noticed a small flaw; I commented it out