1. ## tables?

is there anyway i can print arrays in a form of a table?

if so how can i do it?

2. Print each row of the array and then print a newline.

-Prelude

3. i know how to print out arrays in two columns but how can i make it so there is an exact number of spaces between each column

4. get a string for the line. figure out how many spaces each number will take up, insert as many space characters as needed. output string.

5. Code:
```int table[5][5] =
{ 1, 2, 3, 4, 5,
6, 7, 8, 9, 10,
11, 12, 13, 14, 15,
16, 17, 18, 19, 20,
21, 22, 23, 24, 25 };

for (int i = 0; i<5; i++)
{
for (int j = 0; j<5; j++)
{
if (j == 0) // a beginning '|'
cout << ' table[j][i]  << "| ";
cout << "\n";
}```
That would get the following output:
Code:
```| 1 | 2 | 3 | 4 | 5 |
| 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 |```
That looks a tad unprofessional. You could improve it by checking to see if 'j' is a single digit, and if it is, print out an extra n number of spaces to even up all the lines. Hope that helps!

Brendan

6. You can experiement with using
printf("%4d", i) right justifiy by 4 and
printf("%-4d", i) left justify by 4.

7. That's why you use width specifiers. I believe it's something simple like:

cout << width( 10 ) << 120;

Although, I rarely use C++ so I don't recall off the top of my head.

I'm on a call (imagine that) or I'd look it up.

Actally, it's 'setw( SIZE )'.
[/edit]

Quzah.