简体   繁体   English

翡翠表单元内的按钮

[英]Button inside jade table cell

I want to add a button to shown in each row of the table, But the button does not appear cant figure out why. 我想向表的每一行中添加一个按钮,但是该按钮没有出现,无法弄清原因。 I'm new to jade and node js 我是Jade和Node JS的新手

Jade file 玉锉

html 
head
body 


table.table.table(border='1')
    thead
        tr 
        th ID 
        th Name
        th Age
        th City
        th Department
    tbody 
    each row in rows 
        tr 
            td=row.id
            td=row.name
            td=row.age
            td=row.city
            td=row.department
            td button(type='submit',onclick='edit("#{row.id}")') Edit

            script.
                function edit(d){
                var val = confirm ("Do you want to edit the record ?");
                if (val==true){
                return true;
                }
                };

you are not indenting your th's correctly (they need to be indented relative to the tr that they are in) and you need to include an empty one (or set a colspan = 2"on the last th) to accommodate the td that the edit button requires) 您没有正确地缩进您的缩进(他们需要相对于他们所在的tr缩进),并且您需要包括一个空的缩进(或在最后一位上设置colspan = 2“)来容纳编辑的td按钮要求)

thead
    tr 
        th ID 
        th Name
        th Age
        th City
        th Department
        th

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM