Hi.....

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?

Thanks.

Add the proper tags?

See this for help with some of the standard jstl tags that can help with this.

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.

See this on how a table is created in html. Then add the necessary tags and logic.

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.

can you give me a simple example....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.