Table with PUG in NodeJS

0

I'm using PUG template in NodeJS and am looking in documentation how to set up a table. I'm checking in "pugjs.org", but it apparently does not exist ... Does anyone know how to set up a table with PUG?

    
asked by anonymous 14.07.2017 / 01:51

1 answer

1

do as with other parameters

table.table
    thead
        tr
            th Exemplo
            th Exemplo2
    tbody
        tr
            td
            td
        tr
            td
            ....

If you want to do with dynamic data, use each.

table.table(class=type)
    thead
        tr
            each head, i in header
                th #{head}
    tbody
        each row,j in data
            tr
                each col,k in row
                    td #{col}
    
14.07.2017 / 02:05