【发布时间】:2022-11-07 19:37:35
【问题描述】:
如何在 pug 表格的第一行添加动态添加的 tr 数据? 这里它在底部添加
我写的代码...
任何帮助将不胜感激...在此先感谢
<tbody>
if records.length
each record, index in records
- const sl = index + 1, id = record._id.toString();
tr(class="data record" data-id= id)
th(scope="row") #{sl}
td(class="name") #{record.studentName}
td(class="subject") #{record.subject}
td(class="theory") #{record.theory}
td(class="practical") #{record.practical}
td(class="total") #{record.total}
td
a(href="#" class="editBttn") Edit
td
a(href="#" class="delBttn") Delete
else
tr(class="data no-record")
td(colspan="8") No records are available...
</tbody>
【问题讨论】:
-
“动态添加的 tr 数据”到底是什么意思?
-
动态添加表格行数据
-
从表单的输入打印数据
-
考虑颠倒
record列表/数组中项目的顺序。
标签: javascript html pug