Columns and Rows in text file

Anyone please tell me how i draw such a thing in .TXT file using file handling.
This output must be in columns and rows and in well arranged form.

No. 	Name 	Roll No. 	Physic 	Math 	Compuer Science 	Islamiyat 	Pak Studies 	Average 	Grade 
1 	Student Name 	12345 	50 	60 	70 	76 	90 	81 	A 
2 	Student Name 	12345 	55 	52 	50 	80 	58 	55 	C 
3 	Student Name 	12345 	85 	66 	90 	88 	77 	75 	B 
4 	Student Name 	12345 	40 	70 	91 	45 	56 	85 	A 
5 	Student Name 	12345 	30 	80 	80 	55 	93 	45 	D 

I would take a look at the iomanip library (http://www.cplusplus.com/reference/iomanip/ ) which should do exactly what you want.
Can you please give me a sample code?
something like this:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream myfile;
myfile.open("myfile.txt");
myfile<<"No.          Name      Roll No.             Physic       Math         Computer science                Islamiyat              Pak Studies                Average    Grade  "<<endl
      <<"1              Student Name      12345   50              60              70         76        90               81      A"<<endl
      <<"2              Student Name      12345   55              52              50         80        58               55      C"<<endl;
myfile.close();
}
Topic archived. No new replies allowed.