aspose file tools*
The moose likes JSP and the fly likes Tag for HTML table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Tag for HTML table" Watch "Tag for HTML table" New topic
Author

Tag for HTML table

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Hi,
I just browsed through the list of JSTL tags.
I was bit surprised that I did not see any tag for dynamic HTML table creation.
This is a common requirement for many project for example displaying account transaction.
How come JSTL missed this important tag?


Groovy
Shawn Bayern
Author
Ranch Hand

Joined: May 06, 2002
Posts: 160
Originally posted by Pradeep Bhat:
Hi,
I just browsed through the list of JSTL tags.
I was bit surprised that I did not see any tag for dynamic HTML table creation.
This is a common requirement for many project for example displaying account transaction.
How come JSTL missed this important tag?

JSTL is intentionally not HTML-specific. There's really no way to write a generic <table> tag that would be useful in most applications. Instead, you typically build a table up through iteration:

What more would you like? If you suggest a specific alternative, I can probably explain why JSTL didn't include it. There's little way you'd be able to construct a table as generally as with <c:forEach> using some more limited construct -- but I'd be curious to know what you're thinking anyway.


Shawn Bayern<br />"JSTL in Action" <a href="http://www.jstlbook.com" target="_blank" rel="nofollow">http://www.jstlbook.com</a>
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Hi,
I was just wondering if it possible to display tables using a single tag..may be we will be passing the column values of the table and other things like color, size etc as attributes..
But ur code looks fine to me. I agree with U -It is difficult to build a generic tag for displaying table tag. It will no doubt be a quite complicated stuff.
Thanks for clearing my doubt.
Shawn Bayern
Author
Ranch Hand

Joined: May 06, 2002
Posts: 160
Originally posted by Pradeep Bhat:
Hi,
I was just wondering if it possible to display tables using a single tag..may be we will be passing the column values of the table and other things like color, size etc as attributes..
But ur code looks fine to me. I agree with U -It is difficult to build a generic tag for displaying table tag. It will no doubt be a quite complicated stuff.
Thanks for clearing my doubt.

Indeed - more specifically, things like color and size are a function of the presentation tier, not the back-end. In JSP 2.0, if you find yourself using a particular pattern of JSTL tags frequently, you can write a JSP page that becomes its own new tag. (That's a little subtle, so if it seems confusing, don't worry about it for now -- it's just a feature in the future.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag for HTML table
 
Similar Threads
Passing table as parameter to next page(JSTL)
Displaying Tabular data using custom tags
how to get id of many many list within ace:dialog and c:foreach
Generating Horizontal Menu in JSF using h:dataTable
Passing a list of beans from a servlet to jsp page to display in html table