add a delete button for every record in a bootstrap table in PUG

问题: I am trying to add a button for every record in a bootstrap table i am using a pug templating engine.its seems that the tag not working.Please help .jumbotron h1 User...

问题:

I am trying to add a button for every record in a bootstrap table i am using a pug templating engine.its seems that the tag not working.Please help

.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')

回答1:

If you want to nest the input within the td, indent the input under the td like this:

.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')
  • 发表于 2019-02-26 20:43
  • 阅读 ( 208 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除