• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic Population of HTML table content  RSS feed

 
Sijesh Alayaril
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, how to populate dynamic table content in HTML. Anyone please help me.



Regards,
Sijesh
 
Stephan van Hulst
Saloon Keeper
Posts: 7928
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's loads and loads and loads of ways of doing that.

I find it's easiest though if you use an (either client-side or server-side) framework that has a template engine. In Apache Struts 2, the default template language is FreeMarker, but it also supports Velocity and JSP. You can also install plugins that let you use other template engines, such as Thymeleaf.

Have you ever worked with a template language like FreeMarker, Velocity, JSP or Thymeleaf?
 
Sijesh Alayaril
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes , I have worked with JSP. But quite new to HTML.
 
Stephan van Hulst
Saloon Keeper
Posts: 7928
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you done with JSP before?

Anyway, if you know what a table looks like in HTML, and you know how to loop through your data in JSP, then you can just print a <tr> in your JSP loop for every row in your data, and then you can loop through the columns of your row data, and print a <td> for each cell of the row.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!