How to create an html table with Jade iterating an array
I found that the problem was that I was missing the TD tag for each TR. So the jade code should be like this:
div
table
thead
tr: th Posts
tbody
each post, i in userPosts
tr
td
a(href='/admin/post/' + post.id) #{post.author} - #{post.title}
try this
div
table
thead
tr: th Posts
tbody
each post, i in userPosts
tr(class=(i % 2 == 0) ? 'odd' : 'even')
td
a(href='/admin/post/' + post.id) #{post.author} - #{post.title}