【问题标题】:add a delete button for every record in a bootstrap table in PUG为 PUG 中的引导表中的每条记录添加一个删除按钮
【发布时间】:2019-02-25 07:33:15
【问题描述】:

我正在尝试为引导表中的每条记录添加一个按钮,我正在使用 pug 模板引擎。它似乎标签不起作用。请帮助

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

【问题讨论】:

    标签: html express pug


    【解决方案1】:

    如果要将input 嵌套在td 中,请在td 下缩进input,如下所示:

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

    【讨论】:

      猜你喜欢
      • 2016-11-19
      • 2018-07-29
      • 1970-01-01
      • 1970-01-01
      • 2016-12-09
      • 2012-06-09
      • 2021-03-12
      • 2017-09-03
      • 1970-01-01
      相关资源
      最近更新 更多