This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 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: 63354
    
  70

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: 63354
    
  70

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: 63354
    
  70

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
 
It's not a secret anymore!