这是 mytable.js :
var items = [
{code: 'A1', name: 'Soda1', description: 'desc1'},
{code: 'A2', name: 'Soda2', description: 'desc2'},
{code: 'A3', name: 'Soda3', description: 'desc3'},
{code: 'A4', name: 'Soda4', description: 'desc4'},
{code: 'A5', name: 'Soda5', description: 'desc5'},
{code: 'A6', name: 'Soda6', description: 'desc6'},
{code: 'A7', name: 'Soda7', description: 'desc7'},
{code: 'A8', name: 'Soda8', description: 'desc8'},
{code: 'A9', name: 'Soda9', description: 'desc9'},
{code: 'A10', name: 'Soda10', description: 'desc10'},
{code: 'A11', name: 'Soda11', description: 'desc11'}
];
res.render('mytable', {
items: items
})
这是 mytable.jade :
table(border='1')
thead
tr
th #
th Code
th Name
th Description
tbody
each item, i in items
tr
td= i+1
td= item.code
td= item.name
td= item.description
这是结果:
这是我需要的:
如何编辑mytable.jade
以便结果以我需要的方式出现?