如何使用Jade模板旋转HTML表格? (节点/快递/玉)

时间:2015-01-28 08:00:04

标签: node.js express pug

这是 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

这是结果:

myresult.jpg

这是我需要的:

my-need-result.jpg

如何编辑mytable.jade以便结果以我需要的方式出现?

0 个答案:

没有答案