{% regroup column_list_bottom_left by 국내해외 as data0 %}
    {% for eachDom in data0 %}
        {% regroup eachDom.list by 본부 as data1 %}
            {% for eachBonbu in data1 %}
                {% regroup eachBonbu.list by 현장 as data2 %}
                    {% for eachSite in data2 %}
                        <!-- 각 줄별로-->
                        {% for rowData in eachSite.list %}
                            <tr>
                                {% if forloop.first %}
                                    {% if forloop.parentloop.first %}
                                        {% if forloop.parentloop.parentloop.first %}
                                            <td class="data" rowspan="{{eachDom.list|length}}"><div class="align-center ellipsis" style="width:100px;">{{eachDom.grouper}}</div></td>
                                        {% endif %}
                                        <td class="data" rowspan="{{eachBonbu.list|length}}"><div class="align-center ellipsis" style="width:100px;">{{eachBonbu.grouper}}</div></td>
                                    {% endif %}
                                <td class="data" rowspan="{{eachSite.list|length}}"><div class="align-center ellipsis" style="width:250px;">{{eachSite.grouper}}</div></td>
                                {% endif %}

                                <td class="data"><div class="align-center ellipsis" style="width:200px;">{{rowData.업체}}</div></td>
                                <td class="data"><div class="align-center ellipsis" style="width:100px;">{{rowData.입력일수}}</div></td>
                            </tr>
                        {% endfor %}
                    {% endfor %}
            {% endfor %}
    {% endfor %}

템플릿 코드만으로 HTML Table에서 하기와 같은 표를 만들 수 있음

 

 

'코딩' 카테고리의 다른 글

JAVA - Stream 예제  (0) 2022.10.06
Ajax, django 협업 코드  (0) 2022.08.02
Pandas, 데이터 컨트롤링 예시 코드  (0) 2022.08.02
pywin32 - win32com.client / chart control  (0) 2022.08.02
데이터프레임, 파이썬 공부하기  (0) 2021.10.10

+ Recent posts