~ Template certain row to set the background color table

{% if trains %}
            <table class="table table-bordered" id="table01">
                <thead>
                <tr>
                    <th>序号</th>
                    <th align="center">主题</th>
                    <th align="center">讲师</th>
                    <th align="center">已完成</th>
                    <th align="center">计划日期</th>
                    <th align="center">培训日期</th>
                    <th align="center">备注</th>
                </tr>
                </thead>
                <tbody>

                {% for i in trains %}
                    <tr {% ifequal i.is_over True %} tr bgcolor="#f5f5dc" {% endifequal %}>
                        <td>{{ i.id }}</td>
                        <td align=" left">{{ i.theme }}</td>
                        <td>{{ i.teacher }}</td>
                        <td>{{ i.is_over }}</td>
                        <td>{{ i.plan_time }}</td>
                        <td>{{ i.action_time }}</td>
                        <td>{{ i.remark }}</td>
                    </tr>

                {% endfor %}
                </tbody>
            </table>
        {% endif %}
12747273-16002fa390940e0c.png
image.png

Reproduced in: https: //www.jianshu.com/p/4b81b03be293

Guess you like

Origin blog.csdn.net/weixin_33973600/article/details/91274278
Recommended