aspose file tools*
The moose likes JSP and the fly likes Choose table tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Choose table tag" Watch "Choose table tag" New topic
Author

Choose table tag

Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95
Hi All,

I have two start table tags . These table style definition actually used to hide and display the contents of the table. What I want is to choose between the two tags based on a condition. Here is the code that I tried.



But the problem with this code is that the table start tag between <c:when> tag is not recognized as the start tag for </table>.
How do I go about solving this problem. I need some ideas, or should I write some javascript functions in order to choose the table tag based on the condition.


SCJP 6.0
Kamal Wickramanayake
Greenhorn

Joined: Jul 10, 2010
Posts: 27


I doubt if you can do like that. Try <table style="display:table">
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61657
    
  67

Romeo Ranjan wrote: the table start tag between <c:when> tag is not recognized as the start tag for </table>.

Why not? Have you looked at the generated HTML to find out what the markup looks like? If the HTML is valid, it doesn't matter how it's generated.

By the way, your if-else construct is very messy. Would not the following be cleaner and clearer?


Alos, why is condition a string rather than a boolean?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95
Thanks a lot Bear, it worked just fine
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 274

Just because the IDE tells you that you have an "unmatched end tag" or whatever doesn't mean the code is invalid. You must be careful with IDEs sometimes.


SCJP 6 || SCWCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Choose table tag