HTML tag closes when inside a condition

Posted by Malharhak on Stack Overflow See other posts from Stack Overflow or by Malharhak
Published on 2012-11-21T16:26:36Z Indexed on 2012/11/21 16:59 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

I'm having a little problem with jade. Here is the following code :

            each user in users
                - if (user.valid == 1)
                    tr(style="color:green;")
                - else
                    tr(style="color:red;")

                        td
                            = user.mail
                        td
                            = user.lastIp
                        td
                            = user.token
                        td
                            = user.valid

My problem is that the tds are created only in the else case. if the if (user.valid == 1) is true, then it creates an empty tr.

Is there a way I can create my tr with this condition, and then only fill them ?

Thanks :)

© Stack Overflow or respective owner

Related posts about html5

Related posts about node.js