aspose file tools*
The moose likes JSP and the fly likes ID attribute in tr, td of table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "ID attribute in tr, td of table" Watch "ID attribute in tr, td of table" New topic
Author

ID attribute in tr, td of table

auvrm papu
Ranch Hand

Joined: Sep 01, 2005
Posts: 105
As I understand, ID attribute should be unique.

If I have a loop of <tr> and <td>, is the below mentiond one legal?
or is there a way to loop the idname???

for example,
one1
one2,
one3...etc

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

Originally posted by Ais Kaly:
As I understand, ID attribute should be unique.

...

is the below mentiond one legal?

I would say that you've answered your own question. If the loop results in more than one instance of the same id, then no.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
auvrm papu
Ranch Hand

Joined: Sep 01, 2005
Posts: 105
Thanks, Please suggest what is the best way to iterate the IDs' in this case
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

This is getting JSP-centric so I've moved this to the JSP forum.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

Well, one way to make each unique is to incorporate the loop index into each iteration. Check out the varStatus attribute of <c:forEach> for info on how to obtain the current iteration index.
[ February 13, 2008: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ID attribute in tr, td of table
 
Similar Threads
How to use multiple forEach Loops in EL?
dynamic text box value into database
Hide table row using one of its TD id
Pagination using display tag and JSTL.Display problem
Free instances held up by c:forEach tag