【问题标题】:jade convert list into table玉将列表转换为表格
【发布时间】:2016-08-26 16:33:57
【问题描述】:

我正在学习 node.js 并尝试创建一个应用程序。我在将玉器列表更改为表格时遇到问题。这是我要转换的代码

h3.
    Students
  ul
    each student, i in studentlist
      li#student_list_item
        a(href='#') #{student.student} lives at #{student.street} #{student.city}, #{student.state}

这是我想要做的:

h3.
  Students
table.table.table-condensed.table-hover
  th Name
  th Address
  th City
  th State
  th GPA
each student, i in studentlist
  td#student_list_item
    td= student.student
    td= student.street
    td= student.city
    td= student.state
    td= student.gpa

谢谢

【问题讨论】:

    标签: node.js twitter-bootstrap pug


    【解决方案1】:

    您不想为每个学生创建一个新的表格行吗? (对于顶行)。

    tr#student_list_item
    

    而不是

    td#student_list_item
    

    【讨论】:

    • 刚刚试过。没有变化。数据只显示在 1 行。
    • 另外,请确保“每个”都在表格内。 (即每个缩进)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-11
    相关资源
    最近更新 更多