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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 56192
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56192
    
  13

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: 56192
    
  13

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: ID attribute in tr, td of table
 
Similar Threads
Hide table row using one of its TD id
How to use multiple forEach Loops in EL?
Free instances held up by c:forEach tag
dynamic text box value into database
Pagination using display tag and JSTL.Display problem