如何在翡翠/pug中触发换行? [英] How to trigger a new line in jade/pug?

查看:125
本文介绍了如何在翡翠/pug中触发换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在单个表格标签中的换行

I want to write several object attributes in a singular table tab each on a new line

这是我的哈巴狗表代码摘录

here's my pug table code excerpt

table#posts(style="float:right; border: 1px solid green")
        tbody  
            each post in data
                 tr
                    td(style="border: 1px solid green")='Name: ' + post.firstname + ' ' + post.lastname  + 'Date of Birth: ' + post.dob
                    td(style="border: 1px solid green") buttons                    
            else
                 tr  
                    td No posts!

我希望新行位于姓名"和出生日期"之间.感谢您的任何帮助,谢谢!

I want the new line to be between the Name and date of birth. Any help is appreciated, thank you!

推荐答案

添加< br/> 标记

table#posts(style="float:right; border: 1px solid green")
        tbody  
            each post in data
                 tr
                    td(style="border: 1px solid green")
                      | Name: #{post.firstname + ' ' + post.lastname}
                      br
                      | Date of Birth: #{post.dob}
                    td(style="border: 1px solid green") buttons                    
            else
                 tr  
                    td No posts!

您还可以在< p> 标记

这篇关于如何在翡翠/pug中触发换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆