• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Choose table tag

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I doubt if you can do like that. Try <table style="display:table">
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Bear, it worked just fine
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The human mind is a dangerous plaything. This tiny ad is pretty safe:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic