title: How to create an html table with Jade iterating an array
body: <p>I'm starting with node expressjs framework and I came across this problem I can't solve.</p>
  
  <p>I'm trying to display a table with some blog posts (yes, a blog...) but I don't get it done.</p>
  
  <p>This is the Jade template code:</p>
  
  <pre><code>div
    table
      thead
        tr: th Posts
      tbody
        each post, i in userPosts
          tr(class=(i % 2 == 0) ? 'odd' : 'even'): a(href='/admin/post/' + post.id) #{post.author} - #{post.title}
  </code></pre>
  
  <p>And this is the HTML output:</p>
  
  <pre><code>&lt;div&gt;
    &lt;a href="/admin/post/1"&gt;Post 1&lt;/a&gt;
    &lt;a href="/admin/post/2"&gt;Post 2&lt;/a&gt;
    &lt;a href="/admin/post/3"&gt;Post 3&lt;/a&gt;
    &lt;table&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;Posts&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;tr class="odd"&gt;&lt;/tr&gt;
        &lt;tr class="even"&gt;&lt;/tr&gt;
        &lt;tr class="odd"&gt;&lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So, any ideas?</p>