I have a java file to read excel file.

I have stored all the elements of excel file in a variable.

Now i want to show all values of excel file on jsp page in a table format.

All elements are displaying on jsp page but in vertical line.

How can i change them in table?


Edited by pritaeas: Moved.

5 Years
Discussion Span
Last Post by Suvarna-25

Actually, arr is the variable of type ArrayList. arr has stored the

ArrayList. My java file returns arr at the end. I have caught arr in

my jsp file. I used <c:forEach> tag. at present this tag show values

in vertical line. Is it possible that using <c:forEach> tag i can

show values in table? Please can you give me any sample code?



Thanks for reply. I don't want to fill up the cells manually. I want to iterate all the values which are stored in variable arr. How can i iterate values in table?


You don't HAVE a table, you have a list, and from your description it is a SINGLE value list. So you have to remember how many of those values constitute a row so that you can insert the tr tags at the proper time and you have to insert the td tags for each value. Better, if you must have a list, would be a List of Lists, with each contained List being the values from one row, then use a double loop. What about all of this do you NOT understand. You cannot produce an HTML table without placing those tags in the produced HTML.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.