newbie needs help with creating html table

This is a discussion on newbie needs help with creating html table within the C Programming forums, part of the General Programming Boards category; What I'm trying to do is write a program that creates the HTML tags for an N by M table. ...

newbie needs help with creating html table

What I'm trying to do is write a program that creates the HTML tags for an N by M table. Basically I prompt the user for the number of rows N and the number of columns M. Then the program prompts the user for the N times M items that will go into the table, basically a string, or number.

Then the program writes out the HTML for a table that contains the items. I figured what I'll do I'll have any array for the max number of
rows and columns. Then after the user enters the number of rows and columns, a while loop would prompt the user to enter something for that row + column, until they're all filled.

That was my original intention, but all I keep getting is just a whole bunch of words the repeats itself like an never ending loop. And I'm
at a complete loss trying to figure this out.

You seem to be getting the value of MAXRows and MAXColums mixed up. MAXRows and colums as it stands in your code is simply a pointer to an integer and at compile time, its still unitialized. when you do

your comparing a pointer to an integer and your compiler should tell you that.

as for your question, the idea is that you want a loop to circulate up till the max row and clm the user enters and fill it with some info for each clm. so basically you'll be using a nested loop as in the following:i use gets() here only for a quick and dirty solution. use fgets when you actually implement your code

gets updates the string array with the latest input. That is why you only print the last cell. Try tracing the program state and you'll see this.
To have it print what you want, where you want is a logic problem and one that should be pretty easy to figure out...

one way is this: think about it, you have a loop and gets() replaces the array buffer with the latest input, when do you want to print the value that is captured then?

I won't give you the answer this is an exercise for you. And please don't use gets() when you actually code the program, i'll be ousted off the forum for giving you bad advice.