title: Display a list of java objects in velocity templates as html table
body: <p>I am fetching a list of objects from DB. I would like to populate them in to a html table using velocity templates.</p>
  
  <pre><code>&lt;table&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;td&gt;$value1 &lt;/td&gt;
  &lt;td&gt;$value2 &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;!-- Iterate through the list (List&lt;SomeObject&gt;) and display them here,   --&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>For headers I am using the below code,</p>
  
  <pre><code>VelocityContext context = new VelocityContext();
  context.put("value1", "text1");
  context.put("value2", "text2");
  </code></pre>
  
  <p>I get data from objects as below,</p>
  
  <pre><code>List&lt;SomeObject&gt; obj = new ArrayList&lt;SomeObject&gt;();
  obj.getItem1();
  obj.getItem2();
  </code></pre>
  
  <p>All the individual items are Strings. How to populate the table body content?</p>