Fork me on GitHub

python | table 表格合并列

<table class="static-table"><thead><tr><th>&nbsp;</th> <th>序号</th> <th>网站名称</th> <th>相关篇数</th></tr></thead> <tbody>

        {% for dict_list in wangzhantongji1  %}

            {% for key,value in dict_list.items() %}

                {% if key == "functionname" %}

                <tr>

                    <td width="15%" rowspan={{dict_list["counte"]|length}}>{{dict_list["functionname"]}}</td>

                {% else %}

                {% for data in value%}

                    {% if loop.first %}

                    <td width="11%">{{data["number"]|he}}</td>

                    <td width="11%">{{data["name"]|he}}</td>

                    <td width="11%">{{data["count"]|he}}</td>

                    </tr>

                    {% else %}

                    <tr>

                        <td width="11%">{{data["number"]|he}}</td>

                        <td width="11%">{{data["name"]|he}}</td>

                        <td width="11%">{{data["count"]|he}}</td>

                    </tr>

                    {% endif%}

                {% endfor %}

                {% endif %}

            {% endfor %}

        {% endfor %}

        </tbody>

</table>

 

posted @ 2020-03-16 15:41  MR_黄Python之路  阅读(992)  评论(0编辑  收藏  举报