在玉中呈现表格

时间:2014-02-11 04:25:18

标签: pug

这是我的JADE脚本...我想在表格中添加数据.. 数据获取字符串化的JSON。

doctype html
html
    head 
        title My App
        link(rel='stylesheet', href='/stylesheets/styleS.css')

        script.
            var table=document.getElementById('tab');
            var **data**=!{user}
            function fillTable()
            {

            }
    body(onload="fillTable()")
        form(action='/ADD', method='post')
            h1#wel Welcome To My App
            br
            p#arr
                label(class="info")|ID:
                input(type='text', name='eid', class='clsTxt',id='eid', required,autofocus) 
                br
                br
                label(class="info")|Name:
                input(type='text', name='ename', class='clsTxt', id='ename', required) 
                br
                br
                label(class="info")|Dept:
                input(type='text', name='dept', class='clsTxt', id='dept', required)
            p#arrs
                input(type='submit', name="subBtn",class='clsAdd', value='ADD')
        table#tab(border='1')
            tr
                td Employee ID
                td Name
                td Department

1 个答案:

答案 0 :(得分:0)

mixin add(obj)
form(action='/Delete',method='post')
    table.obj(class="dat",id="mytab")
        tr#headtag
            th Employee ID
            th Name
            th Department
            th Click To Edit/Delete
           each o in obj
                tr
                    td=o._id
                    td=o.ename
                    td=o.dept
                    td.but<input type="button" value="Edit" class="ed"     onclick="editRec(this)">
                    <input type="submit" value="Delete" class="del" onclick="delRec(this)">

+添加(用户)