Issue resolved. I was struggling all round while loop.
It was a simple class to display to result to html table using class. I wanna extend it now.
Possible addition may be.
1. Adding extra clickable column to table rows action queries.
2. Adding alternate row css class for alternate row colors.
3. Table header row css class for styling.
and may be few other functions so that this class can be used in almost any project. All forum members are invited to suggets or contributes to this generic class. It may be useful to many.