How rotation row in HTML table using Jade Template?

112 views
Skip to first unread message

wan jarus

unread,
Jan 29, 2015, 3:20:50 AM1/29/15
to jad...@googlegroups.com

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

result:
# Code Name Description
1 A1 Soda1 desc1
2 A2 Soda2 desc2
3 A3 Soda3 desc3
4 A4 Soda4 desc4
5 A5 Soda5 desc5
6 A6 Soda6 desc6
7 A7 Soda7 desc7
8 A8 Soda8 desc8
9 A9 Soda9 desc9
10 A10 Soda10 desc10
11 A11 Soda11 desc11


Where can edit line in mytable.jade then result must like as my-need-result?

my-need-result: my-need-result.jpg

Thank you.
WJ.


Forbes Lindesay

unread,
Feb 9, 2015, 6:30:07 AM2/9/15
to jad...@googlegroups.com
Try opening an issue on GitHub.  You’re more likely to get answers there.

Forbes Lindesay
for...@lindesay.co.uk
07799504055


--
You received this message because you are subscribed to the Google Groups "Jade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jadejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages