If I understand your question correctly you don't need one table, you need several. Each table should contain different entities, for example
- Person, containing name, class etc
- Subject containing name and so on
- Grade containing information about individual grades for persons and so on
I suggest going through
Database normalization - Wikipedia, the free encyclopedia[
^] before creating the tables.