How rotate HTML table using Jade Template? (Node/Express/Jade)

六月ゝ 毕业季﹏ 提交于 2019-12-25 16:27:09

问题


Here's 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
})

And here's 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

This is the result:

This is what I need:

How can I edit mytable.jade so the result comes out the way I need it?

来源:https://stackoverflow.com/questions/28187290/how-rotate-html-table-using-jade-template-node-express-jade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!