Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Choose table tag

 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kamal Wickramanayake
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I doubt if you can do like that. Try <table style="display:table">
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Bear, it worked just fine
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic