{{insert_additional_html()}}
<table id="blox_table_id" border="0" cellpadding="1" cellspacing="0" {{create_table_level_css()}} {{create_table_level_css_class()}}>
    <colgroup>
        <col {{create_column_level_css("__JINJA_INDEX__", df.index)}}/>
        {% for i, col_name in enumerate(df.columns) %}
            <col {{create_column_level_css(col_name, df.iloc[slice(None), i])}}/>
        {% endfor %}
    </colgroup>
    <thead {{create_thead_level_css()}}>
        {% for header_index, header_row in enumerate(header_iterable)  %}
            <tr {{create_row_level_css("__JINJA_HEADER__", header_row)}}>
                {% for col_index, col_name in enumerate(df.index.names) %}
                    {% if header_index == len(header_iterable) - 1 %}
                        <th {{create_cell_level_css(col_name, "__JINJA_HEADER__", "__JINJA_INDEX__")}}>
                            {% if df.index.name is not none%}
                                {{modify_cell_content(col_name,  "__JINJA_HEADER__", "__JINJA_INDEX__")}}
                            {% endif%}
                        </th>
                    {% else %}
                        <th {{create_cell_level_css(none, "__JINJA_HEADER__", "__JINJA_INDEX__")}}></th>
                    {% endif %}
                {% endfor %}
                {% for column_idx, (item, columns, colspan, rowspan) in enumerate(header_row) %}
                    <th {{create_cell_level_css(item, "__JINJA_HEADER__", columns[0])}}
                        colspan="{{colspan}}" rowspan="{{rowspan}}">
                        {{modify_cell_content(item, "__JINJA_HEADER__", columns[0])}}
                    </th>
                {% endfor %}
            </tr>
        {% endfor %}
    </thead>
    <tbody>
        {% for row_index, (row_name, row) in zip(
            index_iterable,
            df.loc[slice(None), df.columns.get_level_values(0) != '__MULTIINDEX_ORG_ROW_NAMES__'].iterrows(),
        ) %}
        <tr {{create_row_level_css(row_name, row)}}>
            {% for (item, row_names, rowspan, colspan) in row_index %}
                <td {{create_cell_level_css(item, row_names[0], "__JINJA_INDEX__")}}
                 rowspan="{{rowspan}}" colspan="{{colspan}}">
                    {{modify_cell_content(item, row_names[0], "__JINJA_INDEX__")}}
                </td>
            {% endfor %}
            {% for col_name, cell in row.items() %}
                <td {{create_cell_level_css(cell, row_name, col_name)}}>
                    {{modify_cell_content(cell, row_name, col_name)}}
                </td>
            {% endfor %}
        </tr>
        {% endfor %}
    </tbody>
</table>
