我试图为引导表中的每条记录添加一个按钮,我正在使用哈巴犬模板引擎。它似乎标记无效。请帮助
.jumbotron
h1 User Report
.container
table.table
thead
tr
th(scope='col') Name
th(scope='col') Student ID
th(scope='col') Department
th(scope='col') Edit
tbody
each x,i in info
tr
th(scope='row')= x.name
td= x.studentID
td= x.dept
td= input.btn.btn-primary(id='info.id', type='button', value='Delete')
答案 0 :(得分:0)
如果要将input
嵌套在td
内,请像这样在input
下缩进td
:
.jumbotron
h1 User Report
.container
table.table
thead
tr
th(scope='col') Name
th(scope='col') Student ID
th(scope='col') Department
th(scope='col') Edit
tbody
each x,i in info
tr
th(scope='row')= x.name
td= x.studentID
td= x.dept
td
input.btn.btn-primary(id= info.id, type='button', value='Delete')